lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Miller" <markrmil...@gmail.com>
Subject Re: Searching a untokenized field using SnowballAnalyzer
Date Mon, 21 Aug 2006 18:09:55 GMT
My guess? When you store those field untokenized, they are untokenized. When
you use the SnowBall analyzer with the query parser and search those
untokenized fields, you're query is tokenized. As you can imagine, a
tokenized search by not match un untokenzied field. Why does this not happen
with StandardAnalyzer? Most likely because StandardAnalyzer does not modify
ferrari during it's processing (in fact I know it does not) while
SnowBallAnalyzer probably does modify ferrari...perhaps to ferrar.

The results:

search query: ferrari
query parser /SnowballAnalyzer: ferrar
query parser /StandardAnalyzer: ferrari

- Mark

On 8/21/06, Lorenzo Di Gaetano <lorenzo.digaetano@bassnet.biz> wrote:
>
> Hi all,
>
> I have the following problem. I use SnowballAnalyzer to index Documents
> containing tokenized and untokenized fields. But when I try to search a
> document using one of the untokenized fields (usually keywords and
> unique identifiers) it doesn't find anything...
>
> Simple exampe of code:
>
> doc.add(new Field("car","ferrari",Field.Store.NO,Field.Index.UN_TOKENIZED
> );
>
> when I try to search it using the following search strings:
>
> car:ferrari
>
> or
>
> car:"ferrari"
>
> it finds nothing.
>
> If I use StandardAnalyzer instead of SnowballAnalyzer it finds the
> Document correctly!!! Even the field name and the field value are
> lowercases, it seems that there is a problem on querying untokenized
> fields using SnowballAnalyzer... The only way I have to find my "car"
> field is using TermQueries...  But  I absolutely need  to make complex
> queries on multiple field values at once.
>
> Please help me! Thank you in advance.
>
> Lorenzo
>
> ---------------------------------------------------------------------
> 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