<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # position_increment_gap(短語位置間隙) 被解析的?**text fields**(文本字段)會將?**term**(詞根)的位置考慮進去,目的是為了能支持?**proximity queries**(近似查詢)和?**phrase queries**(短語查詢)。當我們索引一個含有多個值的?**text fields**(文本字段)時,會在各個值之間加入一個"假想"的間隙,這樣就可以阻止大多數跨值匹配的短語查詢。這個間隙的大小使用?**position_increment_gap?**參數來設定,默認值是100。 例如: ``` curl -XPUT 'localhost:9200/my_index/groups/1?pretty' -H 'Content-Type: application/json' -d' { "names": [ "John Abraham", "Lincoln Smith"] } ' curl -XGET 'localhost:9200/my_index/groups/_search?pretty' -H 'Content-Type: application/json' -d' { "query": { "match_phrase": { "names": { "query": "Abraham Lincoln" #1 } } } } ' curl -XGET 'localhost:9200/my_index/groups/_search?pretty' -H 'Content-Type: application/json' -d' { "query": { "match_phrase": { "names": { "query": "Abraham Lincoln", "slop": 101 #2 } } } } ' ``` | 1 | 這個短語查詢跟我們預期的一樣,與這個文檔不匹配。 | | 2 | 這個短語查詢會匹配到文檔,因為雖然 **Abraham?**和 **Lincoln**?在不同的 **string**(字符串),但 **slop** &gt;?**position_increment_gap**`。` | **position_increment_gap?**可以在映射時設定特定的值。例如: ``` curl -XPUT 'localhost:9200/my_index?pretty' -H 'Content-Type: application/json' -d' { "mappings": { "groups": { "properties": { "names": { "type": "text", "position_increment_gap": 0 #1 } } } } } ' curl -XPUT 'localhost:9200/my_index/groups/1?pretty' -H 'Content-Type: application/json' -d' { "names": [ "John Abraham", "Lincoln Smith"] } ' curl -XGET 'localhost:9200/my_index/groups/_search?pretty' -H 'Content-Type: application/json' -d' { "query": { "match_phrase": { "names": "Abraham Lincoln" #2 } } } ' ``` | 1 | 下一個數組中的第一個詞根與前一個數組中的最后一個詞根的間隙將會是0。 | | 2 | 這個短語查詢會很奇怪的匹配到我們的文檔,但這個就是我們映射時設定的目的。 | 注意 同一索引中相同名字的字段可以設定不同的 **position_increment_gap **值。他的值可以通過 **[PUT mapping API](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/indices-put-mapping.html "Put Mapping")** 使用同名字段來進行更新。 原文鏈接 : [https://www.elastic.co/guide/en/elasticsearch/reference/5.3/position-increment-gap.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/position-increment-gap.html)(修改該鏈接為官網對應的鏈接) 譯文鏈接 : [http://www.apache.wiki/pages/viewpage.action?pageId=9406794](http://www.apache.wiki/pages/viewpage.action?pageId=9406794)(修改該鏈接為 **ApacheCN** 對應的譯文鏈接) 貢獻者 : [郭峰](/display/~guofeng),[ApacheCN](/display/~apachecn),[Apache中文網](/display/~apachechina)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看