Hi all
I've got an Index with a few 100k documents and I want to run a rather complex
wildcard (incl. leading wildcards) query on it.
The wildcard query takes about 2 seconds to complete.
Now, I want to limit the items on which the wildcard query will be executed.
Let's say, I want to limit the items to those which have the field
"ProductName" set to "milk" (this query itself runs in less than 5 milliseconds
and returns about 100 items).
So, I tried different things but everything resulted in having the exact same
execution time like without this filter. Even if I run the query multiple
times in a row with the same Query and Filter items.
Here's what I tried:
- Adding "+ProductName:milk" to the Query
- Added FieldCacheTermsFilter("ProductName ", new String[] { "milk" })
as Filter
- Wrapped the Filter in CachingWrapperFilter
- Used BooleanQuery filterQuery = new BooleanQuery();
filterQuery.add(new TermQuery(new Term("ProductName", "milk ")),
BooleanClause.Occur.MUST); and wrapped it with a QueryWrapperFilter and also
tried wrapping it in a FilteredQuery
Nothing improved the searchspeed, it had always the same speed as when he
parsed thru all documents without any pre-filtering.
Is this pre-filtering different than I thought? Am I doing something wrong?
Does the index need to be build somehow special for this to work?
Thanks for your help
//Roman
________________________________
Holen Sie die besten Elektronik-Aktionen direkt auf Ihr Facebook-Profil:
http://www.facebook.com/pages/Preissturz/218831069608
Die besten Elektronik-Aktionen auf Twitter: http://twitter.com/preissturz1