First, it only counts if you add multiple entries for the field. Consider the 
following
<doc>
   <field name=“blah”>a b c</field>
   <field name=“blah”>def</field>
</doc>

where the field has a positionIncrementGap of 100. The term positions of the 
entries are
a:1
b:2
c:3
d:103
e:104
f:105

Now consider the doc where there’s only one field:
<doc>
   <field name=“blah”>a b c d e f</field>
</doc>

The term positions are
a:1
b:2
c:3
d:4
e:5
f:6

The use-case is if you, say, index individual sentences and want to match two 
or more words in the _same_ sentence. You can specify a phrase query where the 
slop is < the positionIncrementGap. So in the first case, if I search for “a 
b”~99 I’d get a match. But if I searched for “a d”~99 I wouldn’t.

Best,
Erick

> On Oct 17, 2019, at 2:09 AM, Shubham Goswami <shubham.gosw...@hotwax.co> 
> wrote:
> 
> Hi Community
> 
> I am a beginner in solr and i am trying to understand the working of
> positionIncrementGap but i am still not clear how it exactly works for the
> phrase queries and general queires.
>   Can somebody please help me to understand this with the help fo an
> example ?
> Any help will be appreciated. Thanks in advance.
> 
> -- 
> *Thanks & Regards*
> Shubham Goswami
> Enterprise Software Engineer
> *HotWax Systems*
> *Enterprise open source experts*
> cell: +91-7803886288
> office: 0731-409-3684
> http://www.hotwaxsystems.com

Reply via email to