Hi,
Given the below entity, need to fetch the course where it should match for given languageStr and localizationType inside localizations using hibernate search. For example I want to filter the courses where “languageStr” = “zh” and “localizationType” =“Orginal”, currently it working as `OR" condition, i am looking for “AND” condition. Any help would be appreciated.
@Entity
@Indexed
public class Course{
@KeywordField
@Column(unique = true)
public String id;
@GenericField
public boolean isActive;
@OneToMany(cascade = CascadeType.ALL)
@IndexedEmbedded
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW)
public Set<Localization> localizations = new HashSet<>();
}
@Entity
@Indexed
public class Localization{
@KeywordField
public String languageStr;
@KeywordField(aggregable = Aggregable.YES)
public String localizationType="";
}
Sample Localization data
"localizations": [
{
"languageStr": "zh",
"localizationType": "Orginal"
},
{
"languageStr": "es",
"localizationType": "Subtitled"
},
{
"languageStr": "de",
"localizationType": "Subtitled"
},
{
"languageStr": "en",
"localizationType": "Original"
},
{
"languageStr": "fr",
"localizationType": "Subtitled"
},
{
"languageStr": "ar",
"localizationType": "Subtitled"
},
{
"languageStr": "pt",
"localizationType": "Subtitled"
},
{
"languageStr": "ja",
"localizationType": "Subtitled"
}
]