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: How I can find wildcard symbol with WildcardQuery?
Date Tue, 19 Aug 2008 13:34:53 GMT
Before going down this path I'd really recommend you get a copy of Luke
and look at your index. Depending upon the analyzer you're using, you
may or may not have w*orld indexed. You may have the tokens:
w
orld

with the * dropped completely.

As far as I know, NO_NORMS has nothing to do with tokenization, the
critical question is what *analyzer* you're using to index.

And you could always sidestep the issue entirely by pre-processing
your text and query to replace * with something else.

But for escaping, see:
http://lucene.apache.org/java/2_3_2/queryparsersyntax.html

Best
Erick

2008/8/19 Сергій Карпенко <bergschloss@ukr.net>

>
> Hello
>
> For example, we have a text:
>
> " Hello w*orld"
>  it's indexed as NO_NORMS, so this phrase is term.
>
> And I have a code:
>
> Query query = new WildcardQuery(new Term("field", " Hello w*orld")); its
> work
>
> But I need symbol '*' as ordinary symbol, not escape symbol.
>
> The QueryParser's analogue '\\*'
> Query query = new WildcardQuery(new Term("field", " Hello w\\*orld"));
> don't wokrs.
>
> Thanks
>
>
>
>
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message