lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: indexing analyzed and not_analyzed values in same field
Date Fri, 18 Nov 2016 13:34:34 GMT
You can do this, Lucene will let you, but  it's typically a bad idea
for search relevance because some documents will return only if you
search for precisely the same whole token, others if you search for an
analyzed token, giving the user a broken experience.

Mike McCandless

http://blog.mikemccandless.com


On Fri, Nov 18, 2016 at 6:00 AM, Kumaran Ramasubramanian
<kums.134@gmail.com> wrote:
> Hi All,
>
>    Can anyone say,  is it advisable to have index with both analyzed and
> not_analyzed values in one field?
>
> Use case: i have custom fields in my product which can be configured
> differently ( ANALYZED and NOT_ANALYZED ) in different modules
>
> --
> Kumaran R
>
>
>
>
>
> On Wed, Oct 26, 2016 at 12:07 AM, Kumaran Ramasubramanian <
> kums.134@gmail.com> wrote:
>
>>
>>
>> Hi All,
>>
>> i have indexed 4 documents in an index where BANKNAME field is analyzed
>> in two documents and it is not_analyzed in another two documents. i have
>> mentioned search cases below where i am able to search using both analyzed
>> ( using classic analyzer ) and not_analyzed ( using keyword analyzer )
>> terms. But, is it right to have index with both analyzed and not_analyzed
>> values in a field?
>>
>>
>>
>>
>> output:
>>
>>
>> BANKNAME field of these two documents is analyzed
>>
>> using classic analyzer
>>  query : BANKNAME:"swiss bank"
>> total hits:2
>>
>> DocId:0  DocScore:1.6096026
>> [stored,indexed,tokenized<BANKNAME:swiss  bank>,
>> stored,indexed,tokenized<PLACENAME:swissland>,
>> stored,indexed,tokenized,omitNorms,indexOptions=DOCS_ONLY<company:goog>]
>>
>> DocId:2  DocScore:1.6096026
>> [stored,indexed,tokenized<BANKNAME:swiss  bank>,
>> stored,indexed,tokenized<PLACENAME:swissland>,
>> stored,indexed,tokenized,omitNorms,indexOptions=DOCS_ONLY<company:goog>]
>>
>>
>>
>>
>>
>> BANKNAME field of these two documents is not analyzed
>>
>> using keyword analyzer
>> rrsk query : BANKNAME:swiss bank
>> total hits:2
>>
>> DocId:1  DocScore:1.287682
>> [stored,indexed,tokenized<BANKNAME:swiss bank>,
>> stored,indexed,tokenized<PLACENAME:swiss>, stored,indexed,tokenized,omitN
>> orms,indexOptions=DOCS_ONLY<company:goog>]
>>
>> DocId:3  DocScore:1.287682
>> [stored,indexed,tokenized<BANKNAME:swiss bank>,
>> stored,indexed,tokenized<PLACENAME:swiss>, stored,indexed,tokenized,omitN
>> orms,indexOptions=DOCS_ONLY<company:goog>]
>>
>>
>>
>>
>>
>>
>> --
>> Kumaran R
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message