[Yanel-dev] [Yarep] Index/search properties bugs
Michael Wechner
michael.wechner at wyona.com
Fri May 7 23:33:20 CEST 2010
Michael Wechner wrote:
>
> 2) If a property value contains spaces, then it is not being indexed
> properly, whereas this can be fixed by using
>
> luceneDoc.add(new Field(property.getName(), new
> StringReader(property.getValueAsString())));
please note that according to
http://lucene.apache.org/java/2_0_0/api/org/apache/lucene/document/Field.html#Field(java.lang.String,%20java.io.Reader)
it means "Create a tokenized and indexed field that is not stored. Term
vectors will not be stored. "
>
> instead
> luceneDoc.add(new Field(property.getName(),
> property.getValueAsString(), Field.Store.YES, Field.Index.UN_TOKENIZED));
hence, I think the problem is caused by UN_TOKENIZED. If replaced by
luceneDoc.add(new Field(property.getName(), property.getValueAsString(),
Field.Store.YES, Field.Index.TOKENIZED));
then it should be fine or at least my tests look good so far.
Cheers
Michi
>
> but I am not sure if this is the right approach and need to
> investigate some more.
>
> Cheers
>
> Michi
More information about the Yanel-development
mailing list