<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之旅 廣告
                搜索文檔 要從Elasticsearch中獲取文檔,我們需要使用同樣的_index,_type以及 _id但是不同的HTTP變量GET: GET /website/blog/123?pretty 返回結果包含了之前提到的內容,以及一個新的字段_source,它包含我們在最初創建索引時的原始JSON文檔。 ~~~ { "_index" : "website", "_type" : "blog", "_id" : "123", "_version" : 1, "found" : true, "_source" : { "title": "My first blog entry", "text": "Just trying this out..." "date": "2014/01/01" } } ~~~ pretty 在任意的查詢字符串中添加pretty參數,類似上面的請求,Elasticsearch就可以得到優美打印的更加易于識別的JSON結果。_source字段不會執行優美打印,它的樣子取決于我們錄入的樣子。 GET請求的返回結果中包含{"found": true}。這意味著這篇文檔確實被找到了。如果我們請求了一個不存在的文檔,我們依然會得到JSON反饋,只是found的值會變為false。 同樣,HTTP返回碼也會由'200 OK'變為'404 Not Found'。我們可以在curl后添加-i,這樣你就能得到反饋頭文件: curl -i -XGET /website/blog/124?pretty 反饋結果就會是這個樣子: HTTP/1.1 404 Not Found Content-Type: application/json; charset=UTF-8 Content-Length: 83 ~~~ { "_index" : "website", "_type" : "blog", "_id" : "124", "found" : false } ~~~ 檢索文檔中的一部分 通常,GET請求會將整個文檔放入_source字段中一并返回。但是可能你只需要title字段。你可以使用_source得到指定字段。如果需要多個字段你可以使用逗號分隔: GET /website/blog/123?_source=title,text 現在_source字段中就只會顯示你指定的字段: ~~~ { "_index" : "website", "_type" : "blog", "_id" : "123", "_version" : 1, "exists" : true, "_source" : { "title": "My first blog entry" , "text": "Just trying this out..." } } ~~~ 或者你只想得到_source字段而不要其他的元數據,你可以這樣請求: GET /website/blog/123/_source 這樣結果就只返回: ~~~ { "title": "My first blog entry", "text": "Just trying this out...", "date": "2014/01/01" } ~~~
                  <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>

                              哎呀哎呀视频在线观看