`getPositionIncrementGap` Sent from my BlackBerry® smartphone -----Original Message----- From: Rob Nikander <rob.nikan...@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 < msoko...@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-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > >