lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lichty, Kent" <Kent.Lic...@dsionline.com>
Subject RE: AW: WildcardQuery
Date Fri, 24 May 2002 15:03:54 GMT
Hi... I am both a "newbie" to Lucene and to using this list, so please
forgive me if I make some mistakes. I am trailing onto this post because I
cannot seem to get the "wildcard" function to work at all, while all of the
other features seem to work just fine.  I am using a very standard
application (actually, it is just the demo version slightly modified) with
the StandardAnalyzer and the QueryParser.  But the wildcard feature (using
either "?" or "*") just doesn't work. I must be missing something very
basic.  I would appreciate any ideas. Thanks!

-----Original Message-----
From: Ian Lea [mailto:ian@digimem.net]
Sent: Friday, May 24, 2002 10:00 AM
To: Lucene Users List
Cc: l@digimem.net
Subject: Re: AW: WildcardQuery


Left wildcards seem to work if you explicitly use a
WildcardQuery e.g. 

	Term t = new Term("id", "*ucene");
	Query query = new WildcardQuery(t);


but if use QueryParser with an analyzer e.g.

	Analyzer analyzer = new StandardAnalyzer();
	Query query = QueryParser.parse("*ucene", "id", analyzer);

get an exception:

org.apache.lucene.queryParser.ParseException: 
Lexical error at line 1, column 1.  Encountered: "*" (42), after : ""
  at org.apache.lucene.queryParser.QueryParser.parse(Unknown Source)


Tested on RC5.  Haven't tried other ways of building a query.  In my
simple tests terms with left and right wildcards like "*lucene*"
worked too, even if the whole word was included.



--
Ian.
ian@digimem.net


> schrader.news@evendi.de (Christian Schrader) wrote 
>
> It works with the nightly builds and probably with 1.2-RC5 :-)
> 
> Christian
> > -----Ursprungliche Nachricht-----
> > Von: Otis Gospodnetic [mailto:otis_gospodnetic@yahoo.com]
> > Gesendet: 07 May 2002 17:31
> > An: Lucene Users List
> > Betreff: Re: WildcardQuery
> > 
> > 
> > Yes, me too.  I just tried it on some Lucene index (the search at
> > blink.com) and it doesn't seem to work (try searching for travel and
> > then *vel).
> > I'm assuming the original poster confused something...
> > 
> > Otis
> > 
> > --- Joel Bernstein <j.bernstein@ei.org> wrote:
> > > I thought Lucene didn't support left wildcards like the following:
> > > 
> > > *ucene
> > > 
> > > ----- Original Message -----
> > > From: "Christian Schrader" <schrader.news@evendi.de>
> > > To: "Lucene Users List" <lucene-user@jakarta.apache.org>
> > > Sent: Monday, May 06, 2002 7:14 PM
> > > Subject: WildcardQuery
> > > 
> > > 
> > > > I am pretty happy with the results of WildcardQueries like "*ucen*"
> > > that
> > > > matches lucene, but "*lucene*" doesn't match lucene. Is there a
> > > reason for
> > > > this? And what would be the patch.
> > > > It should be in WildcardTermEnum. I am wondering if somebody
> > > already
> > > patched
> > > > it?
> > > >
> > > > Thanks, Chris

----------------------------------------------------------------------
Searchable personal storage and archiving from http://www.digimem.net/




----------  Internet E-mail Confidentiality Disclaimer  ----------

PRIVILEGED / CONFIDENTIAL INFORMATION may be contained in this message.  If
you are not the addressee indicated in this message or the employee or agent
responsible for delivering it to the addressee, you are hereby on notice
that you are in possession of confidential and privileged information.  Any
dissemination, distribution, or copying of this e-mail is strictly
prohibited.  In such case, you should destroy this message and kindly notify
the sender by reply e-mail.  Please advise immediately if you or your
employer do not consent to Internet email for messages of this kind.

Opinions, conclusions, and other information in this message that do not
relate to the official business of my firm shall be understood as neither
given nor endorsed by it.



--
To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>


Mime
View raw message