Return-Path: Delivered-To: apmail-jakarta-lucene-dev-archive@apache.org Received: (qmail 86282 invoked from network); 12 Feb 2003 17:28:03 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 12 Feb 2003 17:28:03 -0000 Received: (qmail 15469 invoked by uid 97); 12 Feb 2003 17:29:35 -0000 Delivered-To: qmlist-jakarta-archive-lucene-dev@nagoya.betaversion.org Received: (qmail 15462 invoked from network); 12 Feb 2003 17:29:35 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 12 Feb 2003 17:29:35 -0000 Received: (qmail 84539 invoked by uid 500); 12 Feb 2003 17:27:36 -0000 Mailing-List: contact lucene-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Developers List" Reply-To: "Lucene Developers List" Delivered-To: mailing list lucene-dev@jakarta.apache.org Received: (qmail 84485 invoked from network); 12 Feb 2003 17:27:35 -0000 Received: from www12.mailshell.com (HELO mailshell.com) (209.157.66.248) by daedalus.apache.org with SMTP; 12 Feb 2003 17:27:35 -0000 Received: (qmail 28772 invoked from network); 12 Feb 2003 17:27:26 -0000 Received: from unknown (HELO lucene.com) (dcutting@grandcentral.com@12.210.200.74) by mail.mailshell.com with SMTP; 12 Feb 2003 17:27:26 -0000 Message-ID: <3E4A8425.6050602@lucene.com> Date: Wed, 12 Feb 2003 09:28:05 -0800 From: Doug Cutting User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2) Gecko/20021202 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Lucene Developers List Subject: Re: [PATCH] Refactoring QueryParser.jj, setLowercaseWildcardTerms() References: <200302112146.29318.tatu@hypermall.net> In-Reply-To: <200302112146.29318.tatu@hypermall.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N +1 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? Doug 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: lucene-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-dev-help@jakarta.apache.org