79645213

Date: 2025-05-30 09:43:28
Score: 2
Natty:
Report link

I am facing issue in fetching the data. While executing FT.SEARCH command on RedisCLI, I get the JSON records, but with Code I get null.

String searchQuery = "*";
System.out.println("Index Info :: " + searchCommands.ftInfo("my-idx"));  //Correct info
SearchResults<Object, Object> searchResults = searchCommands.ftSearch("my-idx", searchQuery);
System.out.println("Count :: " + searchResults.getCount());  //Getting correct count
for (Document<Object, Object> document : searchResults) {
    Object jsonPayload = document.get(".");    //Both $ & . not giving data
    System.out.println("JSON Payload :: " + jsonPayload);   //null
    System.out.println("Get Payload :: " + document.getPayload());  //null
    System.out.println("Is Empty? : " + document.isEmpty());   //true
}

what is the mistake here? I am using lettucemod :
implementation 'com.redis:lettucemod-spring:4.3.0'

Reasons:
  • Blacklisted phrase (1): I am facing issue
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Urvashi Soni