lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <>
Subject Re: [PATCH] Refactoring QueryParser.jj, setLowercaseWildcardTerms()
Date Wed, 12 Feb 2003 17:28:05 GMT

I like this approach of modifying the query parser through subclassing.

We should consider taking this approach further, e.g., perhaps by making 
addClause(), getFieldQuery() and getRangeQuery() into protected methods, 
so that folks can modify their behavior too.  Thoughts?

Also, I think we should lowercase prefix and wildcard queries by 
default.  This would fix one of the most frequently reported problems. 
Yes, it might also break folks who currently do case-sensitive wildcard 
queries, but I suspect they are far fewer than those who will continue 
to complain about the default case-sensitivity of wildcard searches. 
What do others think?


Tatu Saloranta wrote:
> (since this is the first patch I've done to Lucene, let me know if there are 
> some preferences or if I missed something...)
> I did some small refactorization to QueryParser.jj, to make it easier to 
> create subclasses that override actual query building (without modifying 
> actual parser part). I'll probably try to create my own MultiFieldQueryParser 
> with some changes (different weights for different fields, not necessarily 
> duplicating the whole query etc.), and these changes should make it possible 
> to do that without touching QueryParser.jj itself.
> I also added simple improvement to prefix/wildcard query handling; now it is 
> possible to set a property to enable automatic lowercasing of prefix/wildcard 
> terms (default is false to stay backwards compatible). This is not a complete 
> solution to wildcard query problems, but should help a bit.
> I ran unit tests (without errors), but I wasn't sure if there are unit tests 
> for QueryParser. Hopefully I didn't break anything; changes are fairly minor.
> Let me know if proposed changes make sense,
> -+ Tatu +-

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

View raw message