<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國際加速解決方案。 廣告
                # Date Index Name Processor(日期索引名稱處理器) 原文鏈接 : [https://www.elastic.co/guide/en/elasticsearch/reference/5.3/date-index-name-processor.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/date-index-name-processor.html) 譯文鏈接 : [http://www.apache.wiki/pages/viewpage.action?pageId=10027638](http://www.apache.wiki/pages/viewpage.action?pageId=10027638) 貢獻者 : [那伊抹微笑](/display/~wangyangting),[ApacheCN](/display/~apachecn),[Apache中文網](/display/~apachechina) 該 **processor**(處理器)的目的是通過使用?[date math index name support](https://www.elastic.co/guide/en/elasticsearch/reference/current/date-math-index-names.html "Date math support in index names")?來將文檔指向正確的時間以建立 **index**(索引),該 **date**(時間)基于 **document**(文檔)中的 **date**(日期)或 **timestamp**(時間戳)字段。 該?**processor**(處理器)根據提供的 **index** **name** **prefix**(索引名稱前綴),正在被處理的 **document**(文檔)中的 **date**(日期)或 **timestamp**(時間戳)字段以及所提供的?**date** **rounding**(日期舍入),與?**a date math index name expression**(一個日期的數學表達式索引名稱)來設置?**_index meta field**(元字段)。 首先,該?**processor**(處理器)從正在處理的 **document**(文檔)中的 **field**(字段)抓取?**date**(日期)或?**timestamp**(時間戳)。或者,可以配置?**date** **formatting**(日期格式)以便如何將 **field's value**(字段的值)解析成 **date**(日期)。那么這個 **date**(日期),所提供的 **index name prefix**(索引名稱前綴)和所提供的 **date rounding**(日期舍入)將會被格式化為?**a date math index name expression**(一個日期的數學表達式索引名稱)。此外,還可以選擇?**date** **formatting**(日期格式化)以指定 date(日期)應該如何被格式化成?**a date math index name expression**(一個日期的數學表達式索引名稱)。 以下一個示例 **pipeline**(管道),它將 **documents**(文檔)指向基于 **date1** 字段中日期的,以 **myindex-** 前綴開頭的?**monthly index**(月度索引):? ``` curl -XPUT 'localhost:9200/_ingest/pipeline/monthlyindex?pretty' -H 'Content-Type: application/json' -d' { "description": "monthly date-time index naming", "processors" : [ { "date_index_name" : { "field" : "date1", "index_name_prefix" : "myindex-", "date_rounding" : "M" } } ] } ' ``` 針對 **index request**(索引請求)使用該 **pipeline**(管道):? ``` curl -XPUT 'localhost:9200/myindex/type/1?pipeline=monthlyindex&pretty' -H 'Content-Type: application/json' -d' { "date1" : "2016-04-25T12:02:01.789Z" } ' ``` ``` { "_index" : "myindex-2016-04-01", "_type" : "type", "_id" : "1", "_version" : 1, "result" : "created", "_shards" : { "total" : 2, "successful" : 1, "failed" : 0 }, "created" : true } ``` 以上請求將不會將此 **document**(文檔)放入 **myindex** 索引,而是放入到?**myindex-2016-04-01** 索引中,因為它?**rounded by month**(按月舍入)。產生這樣的結果是因為?**date-index-name-processor**(日期索引名稱處理器)覆蓋了 **document**(文檔)的 **_index** 屬性。 為了查看實際的 **index request**(索引請求)中提供給 **index**(索引)的 **date-math** 值,導致上述 **document**(文檔)被索引到?**myindex-2016-04-01** 中,我們可以使用 **simulate** **request**(模擬請求)來檢查 **processor**(處理器)的效果。 ``` curl -XPOST 'localhost:9200/_ingest/pipeline/_simulate?pretty' -H 'Content-Type: application/json' -d' { "pipeline" : { "description": "monthly date-time index naming", "processors" : [ { "date_index_name" : { "field" : "date1", "index_name_prefix" : "myindex-", "date_rounding" : "M" } } ] }, "docs": [ { "_source": { "date1": "2016-04-25T12:02:01.789Z" } } ] } ' ``` 結果如下 :? ``` { "docs" : [ { "doc" : { "_id" : "_id", "_index" : "<myindex-{2016-04-25||/M{yyyy-MM-dd|UTC}}>", "_type" : "_type", "_source" : { "date1" : "2016-04-25T12:02:01.789Z" }, "_ingest" : { "timestamp" : "2016-11-08T19:43:03.850+0000" } } } ] } ``` 上述示例 **index**(索引)已設置為?**&lt;myindex-{2016-04-25||/M{yyyy-MM-dd|UTC}}&gt;**。**Elasticsearch** 理解這個意思,**2016-04-01** 正如?[date math index name documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/date-math-index-names.html "Date math support in index names")?所描述的那樣。 ## Table?17.?Date index name options(表 17\. 日期索引名稱選項) | Name(名稱) | Required(必要的) | Default(默認值) | Description(描述) | | --- | --- | --- | --- | | **`field`** | **yes** | **-** | 獲取 **date**(日期)或 **timestamp**(時間戳)的 **field**(字段)。 | | **`index_name_prefix`** | **no** | **-** | 在打印日期之前要添加的 **index name**(索引名稱)的前綴。 | | **`date_rounding`** | **yes** | **-** | 在格式化 **date**(日期)為 **index** **name**(索引名稱)時如何舍入日期。有效值是 : `y`?(year),?`M`(month),?`w`?(week),?`d`?(day),?`h`?(hour),?`m`?(minute) and?`s`?(second)。 | | **`date_formats `** | **no** | **yyyy-MM-dd’T'HH:mm:ss.SSSZ** | 預處理 **document**(文檔)中用于解析 **dates**(日期) / **timestamps**(時間戳)的預期的 **date** **formats**(日期格式)的 **array**(數組)。可以是?**Joda**?**pattern**?或者以下格式之一 :?**ISO8601**,**UNIX**,**UNIX_MS**?或?**TAI64N**。 | | **`timezone`** | **no** | **UTC** | 在解析?**date**(日期)以及當 **date math** **index**(日期數學索引)支持解析表達式到具體的 **index** **name**(索引名稱)時所使用的?**timezone**(時區)。 | | **`locale`** | **no** | **ENGLISH** | 在從預處理文檔中解析 date(日期)時要用的 **locale**(語言環境),與解析的?**month names**?或?**week**?**days**?有關。 | | **`index_name_format`** | **no** | **yyyy-MM-dd** | 在打印 **parsed** **date**(解析的日期)到 **index** **name**(索引名稱)時要使用的格式。這里預期是一個有效的 **Joda**?**pattern。** |
                  <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>

                              哎呀哎呀视频在线观看