You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by ZHANG Liang F <Li...@alcatel-sbell.com.cn> on 2012/06/28 04:00:21 UTC

what is precisionStep and positionIncrementGap

Hi,
in the schema.xml, usually there will be fieldType definition like this: <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>

the precisionStep and positionIncrementGap is not very clear to me. Could you please elaborate more on these 2?

Thanks!

Liang

RE: what is precisionStep and positionIncrementGap

Posted by ZHANG Liang F <Li...@alcatel-sbell.com.cn>.
看了你的blog,写得相当不错啊!
我有一个网站www.ecmkit.com,专注内容管理的。有空多交流! 

-----Original Message-----
From: Li Li [mailto:fancyerii@gmail.com] 
Sent: 2012年6月28日 15:54
To: solr-user@lucene.apache.org
Subject: Re: what is precisionStep and positionIncrementGap

read "How it works" of
http://lucene.apache.org/core/old_versioned_docs/versions/3_5_0/api/all/org/apache/lucene/search/NumericRangeQuery.html
if you can read Chinese, I have a blog explaining the details of the implementation.
http://blog.csdn.net/fancyerii/article/details/7256379

On Thu, Jun 28, 2012 at 3:51 PM, ZHANG Liang F <Li...@alcatel-sbell.com.cn> wrote:
> Thanks a lot, but the precisionStep is still very vague to me! Could you give me a example?
>
> -----Original Message-----
> From: Li Li [mailto:fancyerii@gmail.com]
> Sent: 2012年6月28日 11:25
> To: solr-user@lucene.apache.org
> Subject: Re: what is precisionStep and positionIncrementGap
>
> 1. precisionStep is used for ranging query of Numeric Fields. see 
> http://lucene.apache.org/core/old_versioned_docs/versions/3_5_0/api/al
> l/org/apache/lucene/search/NumericRangeQuery.html
> 2. positionIncrementGap is used for phrase query of multi-value fields e.g. doc1 has two titles.
>   title1: ab cd
>   title2: xy zz
>   if your positionIncrementGap is 0, then the position of the 4 terms are 0,1,2,3.
>   if you search phrase "cd xy", it will hit. But you may think it 
> should not match
>   so you can adjust positionIncrementGap to a larger one. e.g. 100.
>   Then the positions now are 0,1,100,101. the phrase query will not match it.
>
> On Thu, Jun 28, 2012 at 10:00 AM, ZHANG Liang F <Li...@alcatel-sbell.com.cn> wrote:
>> Hi,
>> in the schema.xml, usually there will be fieldType definition like
>> this: <fieldType name="int" class="solr.TrieIntField"
>> precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
>>
>> the precisionStep and positionIncrementGap is not very clear to me. Could you please elaborate more on these 2?
>>
>> Thanks!
>>
>> Liang

Re: what is precisionStep and positionIncrementGap

Posted by Li Li <fa...@gmail.com>.
read "How it works" of
http://lucene.apache.org/core/old_versioned_docs/versions/3_5_0/api/all/org/apache/lucene/search/NumericRangeQuery.html
if you can read Chinese, I have a blog explaining the details of the
implementation.
http://blog.csdn.net/fancyerii/article/details/7256379

On Thu, Jun 28, 2012 at 3:51 PM, ZHANG Liang F
<Li...@alcatel-sbell.com.cn> wrote:
> Thanks a lot, but the precisionStep is still very vague to me! Could you give me a example?
>
> -----Original Message-----
> From: Li Li [mailto:fancyerii@gmail.com]
> Sent: 2012年6月28日 11:25
> To: solr-user@lucene.apache.org
> Subject: Re: what is precisionStep and positionIncrementGap
>
> 1. precisionStep is used for ranging query of Numeric Fields. see http://lucene.apache.org/core/old_versioned_docs/versions/3_5_0/api/all/org/apache/lucene/search/NumericRangeQuery.html
> 2. positionIncrementGap is used for phrase query of multi-value fields e.g. doc1 has two titles.
>   title1: ab cd
>   title2: xy zz
>   if your positionIncrementGap is 0, then the position of the 4 terms are 0,1,2,3.
>   if you search phrase "cd xy", it will hit. But you may think it should not match
>   so you can adjust positionIncrementGap to a larger one. e.g. 100.
>   Then the positions now are 0,1,100,101. the phrase query will not match it.
>
> On Thu, Jun 28, 2012 at 10:00 AM, ZHANG Liang F <Li...@alcatel-sbell.com.cn> wrote:
>> Hi,
>> in the schema.xml, usually there will be fieldType definition like
>> this: <fieldType name="int" class="solr.TrieIntField"
>> precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
>>
>> the precisionStep and positionIncrementGap is not very clear to me. Could you please elaborate more on these 2?
>>
>> Thanks!
>>
>> Liang

RE: what is precisionStep and positionIncrementGap

Posted by ZHANG Liang F <Li...@alcatel-sbell.com.cn>.
Thanks a lot, but the precisionStep is still very vague to me! Could you give me a example? 

-----Original Message-----
From: Li Li [mailto:fancyerii@gmail.com] 
Sent: 2012年6月28日 11:25
To: solr-user@lucene.apache.org
Subject: Re: what is precisionStep and positionIncrementGap

1. precisionStep is used for ranging query of Numeric Fields. see http://lucene.apache.org/core/old_versioned_docs/versions/3_5_0/api/all/org/apache/lucene/search/NumericRangeQuery.html
2. positionIncrementGap is used for phrase query of multi-value fields e.g. doc1 has two titles.
   title1: ab cd
   title2: xy zz
   if your positionIncrementGap is 0, then the position of the 4 terms are 0,1,2,3.
   if you search phrase "cd xy", it will hit. But you may think it should not match
   so you can adjust positionIncrementGap to a larger one. e.g. 100.
   Then the positions now are 0,1,100,101. the phrase query will not match it.

On Thu, Jun 28, 2012 at 10:00 AM, ZHANG Liang F <Li...@alcatel-sbell.com.cn> wrote:
> Hi,
> in the schema.xml, usually there will be fieldType definition like 
> this: <fieldType name="int" class="solr.TrieIntField" 
> precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
>
> the precisionStep and positionIncrementGap is not very clear to me. Could you please elaborate more on these 2?
>
> Thanks!
>
> Liang

Re: what is precisionStep and positionIncrementGap

Posted by Li Li <fa...@gmail.com>.
1. precisionStep is used for ranging query of Numeric Fields. see
http://lucene.apache.org/core/old_versioned_docs/versions/3_5_0/api/all/org/apache/lucene/search/NumericRangeQuery.html
2. positionIncrementGap is used for phrase query of multi-value fields
e.g. doc1 has two titles.
   title1: ab cd
   title2: xy zz
   if your positionIncrementGap is 0, then the position of the 4 terms
are 0,1,2,3.
   if you search phrase "cd xy", it will hit. But you may think it
should not match
   so you can adjust positionIncrementGap to a larger one. e.g. 100.
   Then the positions now are 0,1,100,101. the phrase query will not match it.

On Thu, Jun 28, 2012 at 10:00 AM, ZHANG Liang F
<Li...@alcatel-sbell.com.cn> wrote:
> Hi,
> in the schema.xml, usually there will be fieldType definition like this: <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
>
> the precisionStep and positionIncrementGap is not very clear to me. Could you please elaborate more on these 2?
>
> Thanks!
>
> Liang