Hi,
I have a hibernate-search index of about 150.000 Street objects, containing among others the postal code and description.
Now if I have a BooleanQuery like this:
Code:
BooleanQuery query = new BooleanQuery();
query.add(new TermQuery(new Term("postalCode", String.valueOf(postalCode))), Occur.MUST);
query.add(new FuzzyQuery(new Term("description", description), 0.75f), Occur.MUST);
This takes about 120ms.
And this:
Code:
BooleanQuery query = new BooleanQuery();
query.add(new FuzzyQuery(new Term("description", description), 0.75f), Occur.MUST);
Also takes about the same time.
I think that the first query should be way faster, as the more time consuming fuzzy query should only be evaluated for those streets that have a matching postal code.
Any thoughts?