When I manually create a BooleanQuery, as shown below, the resulting
FullTextQuery returns a result size of zero even though there should be at least one matching result. However, if I use the
MultiFieldQueryParser to create a query using the same criteria, the expected results are returned.
Based on the code snippets below, does anyone see what could be wrong?
Code:
BooleanQuery nameQuery = new BooleanQuery();
TermQuery nameTerms = new TermQuery(new Term("name", search.getCriteria()));
...
...
FullTextEntityManager ftem = org.hibernate.search.jpa.Search.getFullTextEntityManager(entityManager);
org.hibernate.search.jpa.FullTextQuery query = ftem.createFullTextQuery(nameQuery, entity);