Skip to content

Indexing nested JSON object impacts FT.SEARCH returning the records. #326

@radhakrishna67

Description

@radhakrishna67

I have issue with indexing nested object. When i index nested object, FT.SEARCH is not returning the records.

Redis OM Spring version: 0.8.3
Spring Boot Version: 3.1.1
Java Version: openjdk version "17.0.2" 2022-01-18

here are Class details and indexing,

@Data
@ToString
@Document("User")
@RequiredArgsConstructor(staticName = "of")
@AllArgsConstructor(access = AccessLevel.PROTECTED)
public class User {

    @NotEmpty(message ="User email field value should not be null or empty")
    @Id
    private String userEmail;
    @Indexed private List<Role> roles;
    @Indexed private Set<String> projects;
    private List<Document> documents;
}

@Data
@RequiredArgsConstructor(staticName = "of")
public class Role {
    @Indexed private String projectId;
    @Indexed private List<String> roles;
    @Indexed private LocalDateTime joinTime;
	
}
"FT.SEARCH" "UserIdx" "@userEmail:{ra****\\@gmail\\.com}"
1) "0"
This is because of indexing  roles

"JSON.GET" "User:ra****@gmail.com"  works totally fine.

FT.SEARCH works totally fine when removing roles Indexing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions