lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craiglan...@gmail.com
Subject Re: How to not span fields with phrase query?
Date Thu, 28 Aug 2014 15:49:19 GMT
`getPositionIncrementGap` 
Sent from my BlackBerry® smartphone

-----Original Message-----
From: Rob Nikander <rob.nikander@gmail.com>
Date: Thu, 28 Aug 2014 10:26:00 
To: <java-user@lucene.apache.org>
Reply-To: java-user@lucene.apache.org
Subject: Re: How to not span fields with phrase query?

Thank you for the explanation. I subclassed Analyzer and overrode
`getPositionIncrementGap` for this field.  It appears to have worked.

Rob


On Thu, Aug 28, 2014 at 10:21 AM, Michael Sokolov <
msokolov@safaribooksonline.com> wrote:

> Usually that's referred to as multiple "values" for the same field; in the
> index there is no distinction between title:C and title:X as far as which
> field they are in -- they're in the same field.
>
> If you want to prevent phrase queries from matching B C X, insert a
> position gap between C and X; so A B C would be positions 0, 1, 2, and X,
> Y, Z might be 4, 5, 6 instead of 3, 4, 5, which is probably what you have
> now
>
> -Mike
>
>
> On 08/28/2014 09:53 AM, Rob Nikander wrote:
>
>> Hi,
>>
>> If I have document with multiple fields "title"
>>
>>      title: A B C
>>      title: X Y Z
>>
>> A phrase search for title:"B C X" matches this document. Can I prevent
>> that?
>>
>> thanks,
>> Rob
>>
>>
>
> ---------------------------------------------------------------------
> 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