Hello,
My search offers users the ability to add optional fields to their search to refine their query. However, I can’t find any documentation on this.
I’m looking to do something like this:
searchSession.search(Entity.class).where(entity -> {
if(fieldValue1Exists){
entity.match().field("fieldName1").matching(fieldValue1);
}
if(fieldValue2Exists){
entity.match().field("fieldName2").matching(fieldValue2);
}
})
In essence, I want to be able to build the query inside the where
clause. How should I do that?