<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之旅 廣告
                # _source field 原文鏈接 : [https://www.elastic.co/guide/en/elasticsearch/reference/5.3/mapping-source-field.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/mapping-source-field.html) 譯文鏈接 : [http://www.apache.wiki/display/Elasticsearch/_source+field](http://www.apache.wiki/display/Elasticsearch/_source+field) 貢獻者 : [朱彥安](/display/~zhuyanan),[ApacheCN](/display/~apachecn),[Apache中文網](/display/~apachechina) 該 **_source**字段包含在索引時傳遞的原始 **JSON?**文檔正文。該 **_source?**字段本身不被索引(因此是不可搜索的),但它被存儲,以便在執行擷取請求時可以返回,例如 **[get](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-get.html)**?或 **?[search](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-search.html)**?。 ### 禁用_source字段 雖然很方便,但是?**_source?**字段確實在索引中有不小的存儲開銷。 因此,可以使用如下方式禁用 :? ``` curl -XPUT 'localhost:9200/tweets?pretty' -H 'Content-Type: application/json' -d' { "mappings": { "tweet": { "_source": { "enabled": false } } } } ' ``` 警告 : ### 在禁用_source 字段之前請考慮 用戶經常禁用 **_source** 字段而不考慮后果,然后為此后悔。 如果 **_source** 字段不可用,則不支持許多功能 : * **[update](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-update.html)**,**[update_by_query](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-update-by-query.html)**,**[reindex](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docs-reindex.html)** ?**APIs**. * 高亮 * 將索引從一 個**Elasticsearch** 索引 **reindex**(重索引)到另一個索引的能力,以更改映射或分析,或將索引升級到新的主要版本。 * 通過查看索引時使用的原始文檔來調試查詢或聚合的能力。 * 潛在的未來可能會自動修復索引損壞的能力。 提示 如果磁盤空間是瓶頸,應是增加壓縮級別而不是禁用 **_source**。 ### The metrics use case 指標用例與其他基于時間或日志記錄的用例不同,因為有許多小型文檔只包含數字,日期或關鍵字。 沒有更新,沒有高亮的請求,并且數據快速老化,因此不需要 **reindex**。 搜索請求通常使用簡單查詢來按日期或標簽過濾數據集,結果作為聚合返回。 在這種情況下,禁用 **_source** 字段將節省空間并減少 **I/O**。 建議在 **metrics case **下禁用 **[_all](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/mapping-all-field.html)** 字段。 ### 包含 / 排除 _source 中的字段 專家級功能是在文檔索引后但在?**_source?**字段存儲之前修剪?**_source?**字段的內容。 警告 從 **_source** 中刪除字段與禁用 **_source** 有類似的缺點,尤其是您不能將文檔從一個 **Elasticsearch** 索引重新索引到另一個。 考慮使用 **[source filtering](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-request-source-filtering.html)**(源代碼)過濾。 可以使用 **includes** / **excludes?**參數(也可以接受通配符),如下所示 :? ``` curl -XPUT 'localhost:9200/logs?pretty' -H 'Content-Type: application/json' -d' { "mappings": { "event": { "_source": { "includes": [ "*.count", "meta.*" ], "excludes": [ "meta.description", "meta.other.*" ] } } } } ' curl -XPUT 'localhost:9200/logs/event/1?pretty' -H 'Content-Type: application/json' -d' { "requests": { "count": 10, "foo": "bar" # 1 }, "meta": { "name": "Some metric", "description": "Some metric description", # 2 "other": { "foo": "one", # 3 "baz": "two" # 4 } } } ' curl -XGET 'localhost:9200/logs/event/_search?pretty' -H 'Content-Type: application/json' -d' { "query": { "match": { "meta.other.foo": "one" # 5 } } } ' ``` | 1234 | 這些字段將從存儲的 **_source** 字段中刪除。 | | 5 | 我們仍然可以搜索這個字段,即使它不在存儲的 **_source**。 |
                  <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>

                              哎呀哎呀视频在线观看