From lucene-dev-return-1261-qmlist-jakarta-archive-lucene-dev=jakarta.apache.org@jakarta.apache.org Thu Apr 18 14:55:33 2002 Return-Path: Delivered-To: apmail-jakarta-lucene-dev-archive@apache.org Received: (qmail 752 invoked from network); 18 Apr 2002 14:55:33 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 18 Apr 2002 14:55:32 -0000 Received: (qmail 826 invoked by uid 97); 18 Apr 2002 14:55:32 -0000 Delivered-To: qmlist-jakarta-archive-lucene-dev@jakarta.apache.org Received: (qmail 787 invoked by uid 97); 18 Apr 2002 14:55:31 -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 776 invoked from network); 18 Apr 2002 14:55:30 -0000 Message-ID: <20020418145531.61380.qmail@web12701.mail.yahoo.com> Date: Thu, 18 Apr 2002 07:55:31 -0700 (PDT) From: Otis Gospodnetic Subject: Re: Wildcard Searching To: lucene-dev@jakarta.apache.org In-Reply-To: <20020317022148.40634.qmail@web12706.mail.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Does anyone know anything about this? Thanks, Otis --- Otis Gospodnetic wrote: > Hello, > > This was a thread on lucene-user initially, but I'm copying > lucene-dev > as well. Sorry about duplicates. > > --- Stefan Bergstrand wrote: > > Doug Cutting writes: > > > > Just noticed this problem in my program. > > > > It seems as if the analyzer passed to QueryParser.parse(), never is > > passed to PrefixQuery (which is what my test case is parsed to). > > > > A quick look in QueryParser.jj confirms this: > > > > q = new PrefixQuery(new Term(field, term.image.substring > > (0, term.image.length()-1))); > > I thought that queries such as 'rou?d' are considered wildcard > queries > by QueryParser.jj, and not Prefix queries, no? > In the default definition of token in QueryParser.jj I see this: > > | (<_TERM_CHAR>)* "*" > > | > (<_TERM_CHAR> | ( [ "*", "?" ] ))* > > > Then further down in QueryParser.jj we have this: > > if (wildcard) > q = new WildcardQuery(new Term(field, term.image)); > > So a WildWuery is being constructed, not PrefixQuery, I think. > > What I don't understand is why the definition of _TERM_START_CHAR > looks > like this: > > | <#_TERM_START_CHAR: ~[ " ", "\t", "+", "-", "!", "(", ")", ":", > "^", > "[", "]", "\"", "{", "}", "~", "*" ] > > > Maybe the name is misleading, but it seems like _TERM_START_CHAR are > the characters that a TERM can start with, because later in > QueryParser.jj we have TERM defined as: > > | (<_TERM_CHAR>)* > > > and _TERM_CHAR has this definition: > > | <#_TERM_CHAR: <_TERM_START_CHAR> > > > So how can we have a "*" in _TERM_START_CHAR when terms are not > allowed > to start with a "*", and if we do have "*", how come we do not have > "?" > as well? > > Can somebodyt correct me in every place where I made false > statements, > assumptions, and conclusions? > > Thanks, > Otis > > > > > From: Howk, Michael [mailto:MHowk@FSC.Follett.com] > > > > > > > > Also, Lucene returns the parsed version of each of our > > > > searches. When we > > > > search by rou*d, Lucene parses it as rou*d (which is what we > > > > would expect). > > > > But when we search by rou?d, Lucene parses it as "rou d". It > > > > seems to wrap > > > > the term in quotes and replace the question mark with a > > > > space. Any ideas? Or > > > > can someone give us an idea of how to understand WildcardQuery > or > > > > WildcardTermEnum? > > > > > > It sounds like the problem is in the query parser. Brian? > > > > > > Doug > > > > > > -- > > > To unsubscribe, e-mail: > > > > > For additional commands, e-mail: > > > > > > > > > > > > -- > > --------------------------- > > Stefan Bergstrand > > Polopoly - Cultivating the information garden > > Ph: +46 8 506 782 67 > > Cell: +46 704 47 82 67 > > Fax: +46 8 506 782 51 > > stefan.bergstrand@polopoly.com, http://www.polopoly.com > > > > -- > > To unsubscribe, e-mail: > > > > For additional commands, e-mail: > > > > > > > > __________________________________________________ > Do You Yahoo!? > Yahoo! Sports - live college hoops coverage > http://sports.yahoo.com/ > > -- > To unsubscribe, e-mail: > > For additional commands, e-mail: > > __________________________________________________ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/ -- To unsubscribe, e-mail: For additional commands, e-mail: