We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
입력은 가능하나 sorting 등은 사용할 수 없다
2018-07-05 04:24:56.170243
PUT default-format { "mappings": { "_doc": { "properties": { "@timestamp" : { "type" : "date" } } } } }
POST default-format/_doc { "@timestamp" : "2018-07-05 04:24:56.170243" }
{ "error": { "root_cause": [ { "type": "mapper_parsing_exception", "reason": "failed to parse [@timestamp]" } ], "type": "mapper_parsing_exception", "reason": "failed to parse [@timestamp]", "caused_by": { "type": "illegal_argument_exception", "reason": "Invalid format: \"2018-07-05 04:24:56.170243\" is malformed at \" 04:24:56.170243\"" } }, "status": 400 }
PUT customized-format { "mappings": { "_doc": { "properties": { "@timestamp" : { "type" : "date", "format" : "yyyy-MM-dd HH:mm:ss.SSSSSS" } } } } }
POST customized-format/_doc { "@timestamp" : "2018-07-05 04:24:56.170243" }
{ "_index": "customized-format", "_type": "_doc", "_id": "55TFZmQByNsCKuKnb22Y", "_version": 1, "result": "created", "_shards": { "total": 2, "successful": 1, "failed": 0 }, "_seq_no": 0, "_primary_term": 1 }
POST customized-format/_doc { "@timestamp" : "2018-07-05 04:24:56.170243" } POST customized-format/_doc { "@timestamp" : "2018-07-05 04:24:56.170244" }
검증
sort
GET customized-format/_search { "query": { "match_all": { } }, "sort": [ { "@timestamp": { "order": "desc" } } ] }
{ "took": 0, "timed_out": false, "_shards": { "total": 5, "successful": 5, "skipped": 0, "failed": 0 }, "hits": { "total": 2, "max_score": null, "hits": [ { "_index": "customized-format", "_type": "_doc", "_id": "CZTJZmQByNsCKuKnu25J", "_score": null, "_source": { "@timestamp": "2018-07-05 04:24:56.170244" }, "sort": [ 1530764696170 ] }, { "_index": "customized-format", "_type": "_doc", "_id": "B5TJZmQByNsCKuKnsG6f", "_score": null, "_source": { "@timestamp": "2018-07-05 04:24:56.170243" }, "sort": [ 1530764696170 ] } ] } }
The text was updated successfully, but these errors were encountered:
higee
No branches or pull requests
입력은 가능하나 sorting 등은 사용할 수 없다
elasticsearch 6.2에서 사용 가능한 date type의 format
2018-07-05 04:24:56.170243
를 색인한다고 하자방법1
방법2
주의할 점
검증
sort
를 해도 millisecond 이하로는 대소를 비교할 수 없다sort
값이 같은 걸 확인할 수 있다Source
The text was updated successfully, but these errors were encountered: