<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國際加速解決方案。 廣告
                # Validate API **validate API**?允許用戶驗證一個可能復雜(expensive)的查詢而不執行它。?我們將使用以下測試數據來解釋_validate: | `PUT twitter/tweet/_bulk?refresh` `{``"index"``:{``"_id"``:``1``}}` `{``"user"`?`:?``"kimchy"``,?``"post_date"`?`:?``"2009-11-15T14:12:12"``,?``"message"`?`:?``"trying out Elasticsearch"``}` `{``"index"``:{``"_id"``:``2``}}` `{``"user"`?`:?``"kimchi"``,?``"post_date"`?`:?``"2009-11-15T14:12:13"``,?``"message"`?`:?``"My username is similar to @kimchy!"``}` | 當發送一個有效查詢時: | `GET twitter/_validate/query?q=user:foo` | 響應包含有效:true: | `{``"valid"``:``true``,``"_shards"``:{``"total"``:``1``,``"successful"``:``1``,``"failed"``:``0``}}` | ### Request Parameters 當執行查詢使用查詢參數q時,傳遞的查詢是使用Lucene查詢解析器的查詢字符串。?還有其他可以傳遞的參數: | Name | Description | | --- | --- | | `df` | 在查詢中未定義字段前綴時使用的默認字段。 | | `analyzer` | 分析查詢字符串時使用的分析器名稱。 | | `default_operator` | 要使用的默認運算符,可以是?**AND**?或?**OR**。?默認為?**OR**。 | | `lenient` | 如果設置為?**true**?將導致基于格式的失敗(例如向數字字段提供文本)被忽略。?默認為?**false**。 | | `lowercase_expanded_terms` | 術語是否自動小寫,默認為**?true?**。 | | `analyze_wildcard` | 是否分析通配符和前綴查詢。?默認為false。 | 查詢也可以在請求主體中發送: | `GET twitter/tweet/_validate/query` `{` `"query"`?`: {` `"bool"`?`: {` `"must"`?`: {` `"query_string"`?`: {` `"query"`?`:?``"*:*"` `}` `},` `"filter"`?`: {` `"term"`?`: {?``"user"`?`:?``"kimchy"`?`}` `}` `}` `}` `}` | 注意 在正文中發送的查詢必須嵌套在查詢鍵中,與?**Search API**?相同。 如果查詢無效,則`返回信息中 valid`?將為 false。?在這里,查詢無效,因為?**Elasticsearch**?知道post_date字段應該是動態映射的日期,foo無法正確解析為日期: | `GET twitter/tweet/_validate/query?q=post_date:foo` `{``"valid"``:``false``,``"_shards"``:{``"total"``:``1``,``"successful"``:``1``,``"failed"``:``0``}}` | 可以指定**?explain**?參數以獲取有關查詢失敗原因的更詳細信息: | `GET twitter/tweet/_validate/query?q=post_date:foo&explain=``true` | 響應是: | `{` `"valid"`?`:?``false``,` `"_shards"`?`: {` `"total"`?`:?``1``,` `"successful"`?`:?``1``,` `"failed"`?`:?``0` `},` `"explanations"`?`: [ {` `"index"`?`:?``"twitter"``,` `"valid"`?`:?``false``,` `"error"`?`:?``"twitter/IAEc2nIXSSunQA_suI0MLw] QueryShardException[failed to create query:...failed to parse date field [foo]"` `} ]` `}` | 當查詢有效時,**explanations?**默認為該查詢的字符串表示形式。 將?**rewrite**?設置為?**true**?時,**explanations?**將更詳細地顯示將要執行的實際Lucene查詢。 模糊查詢(**Fuzzy Queries**): | `GET twitter/tweet/_validate/query?rewrite=``true` `{` `"query"``: {` `"match"``: {` `"user"``: {` `"query"``:?``"kimchy"``,` `"fuzziness"``:?``"auto"` `}` `}` `}` `}` | 響應: | `{` `"valid"``:?``true``,` `"_shards"``: {` `"total"``:?``1``,` `"successful"``:?``1``,` `"failed"``:?``0` `},` `"explanations"``: [` `{` `"index"``:?``"twitter"``,` `"valid"``:?``true``,` `"explanation"``:?``"+user:kimchy +user:kimchi^0.75 #(ConstantScore(_type:tweet))^0.0"` `}` `]` `}` | 相似度查詢(**More Like This**): | `GET twitter/tweet/_validate/query?rewrite=``true` `{` `"query"``: {` `"more_like_this"``: {` `"like"``: {` `"_id"``:?``"2"` `},` `"boost_terms"``:?``1` `}` `}` `}` | 響應: | `{` `"valid"``:?``true``,` `"_shards"``: {` `"total"``:?``1``,` `"successful"``:?``1``,` `"failed"``:?``0` `},` `"explanations"``: [` `{` `"index"``:?``"twitter"``,` `"valid"``:?``true``,` `"explanation"``:?``"((user:terminator^3.71334 plot:future^2.763601 plot:human^2.8415773 plot:sarah^3.4193945 plot:kyle^3.8244398 plot:cyborg^3.9177752 plot:connor^4.040236 plot:reese^4.7133346 ... )~6) -ConstantScore(_uid:tweet#2)) #(ConstantScore(_type:tweet))^0.0"` `}` `]` `}` | 警告 請求只在單個分片上執行,這是隨機選擇的。?查詢的詳細解釋可以取決于哪個分片被命中,并且因此可以從一個請求到另一個請求而變化。
                  <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>

                              哎呀哎呀视频在线观看