lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Beard, Brian" <>
Subject combining Filter's & Query's to search
Date Tue, 09 Oct 2007 14:22:27 GMT
I'm currently using rangeFilter's and queryWrapperFilter's to get around
the max boolean clause limit.

A couple of questions concerning this:

1) Is it good design practice to substitue every term containing a
wildcard with a queryWrapperFilter, and a rangeQuery with a  RangeFilter
and ChainedFilter'ing these together (to avoid the possibility of a
maxBooleanClause limit being exceeded)? 

We have a searcher that stays open continuously, and reopens when we
have new updates (remains to be seen in deployment, but will probably
occur on approximately an hourly basis). So even though we're caching
the filters with the CachedWrapperFilter, any particular cached filter
may not get used that often and extraneous ones may be left around. The
index will eventually have up to 1/2 million+ records at 3-4K per
document ~1-2GB. We're also using multiple indexes with MultiSearcher to
be able to tailor how the updates are done. (Currently at 2 indexes for
two data sources). It's also a user requirement to be able to search on
leading wildcards.

2) The second part of this has to do with whether a mechanism like
QueryParser exists to help with constructing the filters above.
Currently, I'm using ChainedFilter to chain filters together. But this
works at just the top level. Is it possible from a nested boolean
expression to appropriately insert a FilteredQuery at the right spot.

So, for example, if the query were
name:joe OR (id:123 AND date:[20070101 TO 20071231])

    It would be possible to use something like, rangeFilter)

    It would also be possible to use a FilteredQuery with id and a   
    RangeFilter first, and using a BooleanQuery with an OR. 

Is there any way in Lucene to automatically construct FilteredQuery's
when the search is done? I'm basically trying to be lazy and not
re-write something as complicated as QueryParser.parse if it already
exists. It would be great to use the power of QueryParser so that
rangeFilters were always used instead of a RangeQuery.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message