lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Willnauer <>
Subject Basic Queries are not pluggable
Date Fri, 12 Jun 2009 13:11:05 GMT
Hey there,

I have a had quite a couple of usecases where I had to change some
tiny things in basic queries like BooleanQuery. I subclassed those
queries and applied the change - no problem so far. But I wanted
lucene to use this modified query everywhere in other queries and (for
sure) in the query parser. The query parser integration was easy -
subclassed it and override new*Query() methods. The rest of lucene was
a nightmare and I eventually used a source distribution and changed it
in the actual implementation - don't comment this, I hate it!
I thought about this topic for a while and want to throw it out to the
list for discussion.

I would really appreciate to see some kind of factory methods used for
query construction for instance in the Query#rewrite() implementations
as well as in the QueryParser classes. Such a factory could be user
provided or by default simple call the constructor of the target
class. A patch for this would not break and backwards compat. afaik
and could help quite a couple of people out there I guess.


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

View raw message