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

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # Date 原文鏈接: [https://www.elastic.co/guide/en/elasticsearch/reference/5.4/date.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/date.html) 譯文鏈接: [http://www.apache.wiki/pages/editpage.action?pageId=10031175](http://www.apache.wiki/pages/editpage.action?pageId=10031175) 貢獻者: [張學](/display/~zhangxue),[ApacheCN](/display/~apachecn),[Apache中文網](/display/~apachechina) JSON沒有date這種數據類型, 所以elasticsearch中的date可以是以下形式: * 包含格式化日期的字符串,例如 “2015-01-01”或“2015/01/01 12:10:30”。 * 代表milliseconds-since-the-epoch的長整型數。 * 代表seconds-since-the-epoch的整型數。 在內部,日期將轉換為UTC(如果指定了時區),并將其存儲為表示milliseconds-since-the-epoch的長整型數。 日期格式可以自定義,但如果沒有指定格式,則使用默認格式: ``` "strict_date_optional_time||epoch_millis" ``` 這意味著它將接受帶有可選時間戳的日期,這些日期符合strict_date_optional_time或者milliseconds-since-the-epoch所支持的格式。 例如: ``` PUT my_index { "mappings": { "my_type": { "properties": { "date": { "type": "date" #1 } } } } } PUT my_index/my_type/1 { "date": "2015-01-01" } #2 PUT my_index/my_type/2 { "date": "2015-01-01T12:10:30Z" } #3 PUT my_index/my_type/3 { "date": 1420070400001 } #4 GET my_index/_search { "sort": { "date": "asc"} #5 } ``` | 1 | 日期屬性使用的默認格式。 | | 2 | 本文檔使用純文本。 | | 3 | 本文檔包含了一段時間。 | | 4 | 本文檔使用milliseconds-since-the-epoch. | | 5 | 請注意,返回的排序值全部以毫秒為單位。 | ### 多日期格式 可以使用||分隔多個格式 作為分隔符。 將依次嘗試每種格式,直到找到匹配的格式。 第一個格式將用于將從時間的毫秒轉換為字符串。 ``` PUT my_index { "mappings": { "my_type": { "properties": { "date": { "type": "date", "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis" } } } } } ``` ### date字段的參數 **date**字段接受以下參數: | [`boost`](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/mapping-boost.html "boost") | 映射字段級查詢時間提升。 接受一個浮點數,默認為**1.0**。 | | [`doc_values`](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/doc-values.html "doc_values") | 該字段是否應該以多列的方式存儲在磁盤上,以便以后可以將其用于排序,聚合或腳本? 接受**true**(默認)或**false**。 | | [`format`](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/mapping-date-format.html "format") | 可以解析的日期格式。默認是`strict_date_optional_time&#124;&#124;epoch_millis。` | | `locale` | 由于月份沒有一致的名字或者縮寫,locale 一般應用在日期解析上。 默認為?[`ROOT`?locale](https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html#ROOT), | | [`ignore_malformed`](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/ignore-malformed.html "ignore_malformed") | 如果為真,則格式錯誤的數字將被忽略。 如果為**false**(默認),格式錯誤的數字會引發異常并拒絕整個文檔。 | | [`include_in_all`](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/include-in-all.html "include_in_all") | 字段值是否應包含在**_all**字段中? 接受真或假 如果**index**設置為**false**,或者如果父對象字段將**include_in_all**設置為**false**,則默認為**false**。 否則默認為**true**。 | | [`index`](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/mapping-index.html "index") | 應該可以搜索該字段嗎? 接受**true**(默認)和**false**。 | | [`null_value`](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/null-value.html "null_value") | 接受一個配置格式的日期值作為替換任何顯式空值的字段。 默認為**null**,這意味著該字段被視為丟失。 | | [`store`](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/mapping-store.html "store") | 字段值是否應與**_source**字段分開存儲和檢索。 接受**true**或**false**(默認)。 |
                  <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>

                              哎呀哎呀视频在线观看