<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>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ## 地理坐標盒模型過濾器 這是目前為止最有效的 地理坐標過濾器了,因為它計算起來非常簡單。 你指定一個矩形的 `頂部`(`top`), `底部`(`bottom`), `左邊界`(`left`), 和 `右邊界`(`right`), 然后它只需判斷坐標的經度是否在左右邊界之間,緯度是否在上下邊界之間。(譯注:原文似乎寫反了) ```json GET /attractions/restaurant/_search { "query": { "filtered": { "filter": { "geo_bounding_box": { "location": { <1> "top_left": { "lat": 40.8, "lon": -74.0 }, "bottom_right": { "lat": 40.7, "lon": -73.0 } } } } } } } ``` - <1> 盒模型信息也可以用 `bottom_left`(左下方點)和 `top_right`(右上方點) 來表示。 ### 優化盒模型 `地理坐標盒模型過濾器`不需要把所有坐標點都加載到內存里。 因為它要做的只是簡單判斷 `緯度` 和 `經度` 坐標數值是否在給定的范圍內,所以它可以用倒排索引來做一個范圍(`range`)過濾。 要使用這種優化方式,需要把 `geo_point` 字段用 `緯度`(`lat`)和`經度`(`lon`)方式表示并分別索引。 ```json PUT /attractions { "mappings": { "restaurant": { "properties": { "name": { "type": "string" }, "location": { "type": "geo_point", "lat_lon": true <1> } } } } } ``` - <1> `location.lat` 和 `location.lon` 字段將被分別索引。它們可以被用于檢索,但是不會在檢索結果中返回。 然后,查詢時你需要告訴 Elasticesearch 使用已索引的 `lat`和`lon`。 ```json GET /attractions/restaurant/_search { "query": { "filtered": { "filter": { "geo_bounding_box": { "type": "indexed", <1> "location": { "top_left": { "lat": 40.8, "lon": -74.0 }, "bottom_right": { "lat": 40.7, "lon": -73.0 } } } } } } } ``` - <1> 設置 `type` 參數為 `indexed` (默認為 `memory`) 來明確告訴 Elasticsearch 對這個過濾器使用倒排索引。 > 注意: > `geo_point` 類型可以包含多個地理坐標點,但是針對經度緯度分別索引的這種優化方式(`lat_lon`)只對單個坐標點的方式有效。
                  <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>

                              哎呀哎呀视频在线观看