hardy.ferentschik wrote:
Hi,
if we are looking at the same FAQ -
http://wiki.apache.org/lucene-java/LuceneFAQ - it is saying that you can use a
MultiPhraseQuery as work around. Is this what you are after.
If not, can you describe your use case in more detail and what you expect Hibernate Search to do?
--Hardy
What I would like to do is search on the following type of string : "hell* mis*". This is not possible using Hibernate Search API. I did the following but I guess this is not the optimal way :
Code:
String[] searchTerms = searchString.split(" ");
BooleanQuery orQuery = new BooleanQuery();
for (String searchTerm : searchTerms) {
Query query = builder
.keyword()
.wildcard()
.onField(TraductionPhrase.TEXT + "." + TextTraduction.VALUE)
.matching(searchTerm).createQuery();
orQuery.add(query, Occur.SHOULD);
}
And doing it this way, I loose the phrase method options (such as slop).