We are using hibernate search orm 5.9.2 and would like to achieve the exact search results like:
If user starts with
John -> all data with John should display
John Murphy -> all data with John murphy should display
John murphy Columbia -> Only data with John murphy Columbia should display
John murphy Columbia SC -> Only data with John murphy Columbia should display
John murphy Columbia SC 29201 -> Only data with John murphy Columbia SC 29201
29201 -> Only data with 29201 as zipcode should be displayed.
and so on...
Basically we are trying to achieve search on exact records from multiple fields on index.
We have entity containing this data in fields like Name, Address1, address2, city, zipcode, state.
We have tried bool()
(with should/must) queries, but as we are not sure what data will user enter first, it could be zipcode, state, city any where in the text search.
Please share your knowledge/logic with regards to analyzers/strategy which we can use to accomplish this with hibernate search/lucene.