positionIncrementGap - what is its value meaning?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

positionIncrementGap - what is its value meaning?

Vinci
Hi all,

While I changing the default schema.xml, I found this attribute where defined the analyzer...seems it will add some space when multiple fields appear in document, but what is its effect appear in query and what is the values mean here?

Thank you,
Vinci
Reply | Threaded
Open this post in threaded view
|

Re: positionIncrementGap - what is its value meaning?

Erik Hatcher

On Mar 26, 2008, at 3:11 AM, Vinci wrote:
> While I changing the default schema.xml, I found this attribute where
> defined the analyzer...seems it will add some space when multiple  
> fields
> appear in document, but what is its effect appear in query and what  
> is the
> values mean here?

Suppose you add two tokenized "author"s for a document:

    author: Billy Bob
    author: Thorton Gospodnetic

Without a position gap, the phrase query of "Bob Thorton" would  
match!   However, with a position increment gap defined you can avoid  
that match.  The value you set that gap to depends on whether you'll  
be using sloppy phrase queries, and how sloppy they'll be and whether  
you desire matching across field instances.  Under the covers,  
remember, that a tokenized field is just a string of terms, even with  
multiple field instances.

        Erik

Reply | Threaded
Open this post in threaded view
|

Re: positionIncrementGap - what is its value meaning?

Vinci
Hi Erik,

Thank you for your help. This is useful.
Some follow up questions,

Erik Hatcher wrote
..The value you set that gap to depends on whether you'll  
be using sloppy phrase queries, and how sloppy they'll be and whether  
you desire matching across field instances.  
1. If I doesn't care the sloppy queries, I just set a number larger than 0 and then it will work?
2. If the sloppy queries use a range larger than the gap, what will happen?

Thank you,
Vinci
Reply | Threaded
Open this post in threaded view
|

Re: positionIncrementGap - what is its value meaning?

Erik Hatcher

On Mar 26, 2008, at 10:15 PM, Vinci wrote:

> Erik Hatcher wrote:
>>
>> ..The value you set that gap to depends on whether you'll
>> be using sloppy phrase queries, and how sloppy they'll be and whether
>> you desire matching across field instances.
>>
>
> 1. If I doesn't care the sloppy queries, I just set a number larger  
> than 0
> and then it will work?

Yes.

> 2. If the sloppy queries use a range larger than the gap, what will  
> happen?

Then you can match across field instance boundaries.

        Erik