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'