lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Lea <...@digimem.net>
Subject Re: AW: WildcardQuery
Date Fri, 24 May 2002 15:00:28 GMT
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/


Mime
View raw message