lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: Queries not derived from the text index
Date Tue, 07 Feb 2006 15:25:18 GMT

On Feb 7, 2006, at 1:09 AM, Daniel Noll wrote:
> I've got an unusual (if not crazy) question about implementing  
> custom queries.
> Basically we have a UI where a user can enter a query and then  
> select a bunch of filters to be applied to the query.  These  
> filters are currently implemented using a fairly simple wrapper  
> around Lucene's own Filter class.
> Now we have one particular customer who says he wants to AND and OR  
> these filters in various combinations.  Now, I know that this is  
> possible on the model side, because I've already created AndFilter  
> and OrFilter classes to do this sort of thing.  However, the view  
> of the user interface would be impossible to keep simple if I were  
> to bulk it up to support this kind of filtering.

One thing that may be of use is the ChainedFilter: 

> Is it possible to customise the QueryParser so that it returns  
> Query instances that have no relationship to the text index  
> whatsoever?  For instance, many of our existing filters build their  
> bitsets exclusively using a database, and we would need to keep  
> this as-is because we don't want to modify the text index itself.

I don't really follow what you're after here.  Could you give a  
concrete example of what you're after with "query" parsing?

It's certainly feasible to build a custom parser (JavaCC or  
otherwise) that does whatever you want, but that can be quite a  
complex endeavor.


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

View raw message