I have attempted this with phrase, wildcard and keyword queries but nothing really works perfectly.
...
@Field(name = "firstLastName", index = org.hibernate.search.annotations.Index.YES, analyze = Analyze.NO, store = Store.NO)
public String getFirstLastName() {
return this.firstLastName;
}
...
Now I want to query this field and return the correct results if a user types John Smith, Smith John or Smith Jo* or John Smi*....
junction = junction.should(qb.keyword().wildcard().onField("firstLastName")
.matching("John Smith*").createQuery());
If I search for just Smith or John given a keyword query, I get a hit. I am not analyzing the field as I didn't think I needed to but I tried it both ways with no success...