lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erick Erickson" <erickerick...@gmail.com>
Subject Re: Problem using wildcardsearch in phrase search
Date Sun, 13 May 2007 00:42:15 GMT
See below....

On 5/12/07, Mark Miller <markrmiller@gmail.com> wrote:
>
>
>
> Paul Taylor wrote:
> > I seem to be having problems using a * in a phrase term query
> >
> > This is my search String, its not finding any matches
> > 54:"MusicIP PUID*"
> >
> > If I match on a particular record it works ok
> > 54:"MusicIP PUIDa39494bf-927e-1638-fb06-782ec55ac22d"
> >
> "MusicIP PUID*" means to search for MusicIP within one of PUID*...I am
> pretty sure that KeywordAnalyzer does not split on whitespace like
> WhiteSpaceAnalyzer does...


Perhaps not like whitespaceanalyzer does in all cases, but this code

            QueryParser qp = new QueryParser("field", new
WhitespaceAnalyzer());

            Query q = qp.parse("Does this tokenize*");
            System.out.println(q.toString());

produces

field:Does field:this field:tokenize*



while this code
            QueryParser qp = new QueryParser("field", new
KeywordAnalyzer());

            Query q = qp.parse("Does this tokenize*");
            System.out.println(q.toString());


Produces:
field:Does field:this field:tokenize*

The only difference is using KeywordAnalyzer rather than WhitespaceAnalyzer.

I sure don't see the difference, and it's puzzled me on and off.

Erick

which means that MusicIP is never within one
> of PUID*..."MusicIP PUIDa39494bf-927e-1638-fb06-782ec55ac22d" is one
> whole token.
>
> - Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message