[英]elastic search java client mapper_parsing_exception failed to parse field [timeStamp] of type [long] in document?
I am accessing elastic search by java client.我正在通过 java 客户端访问弹性搜索。 i was inserting date as timestamp in long.
我正在插入日期作为时间戳。 but now want to store in like 2019-12-02T12:08:54.053Z .
但现在想存储在2019-12-02T12:08:54.053Z 中。 i am getting bellow error.
我收到波纹管错误。
"type":"mapper_parsing_exception","reason":"failed to parse field [timeStamp] of type [long] in document
however i did not set any kind of data type for time stamp field, then why i am getting such kind of exception.但是我没有为时间戳字段设置任何类型的数据类型,那么为什么我会收到这种异常。 is there any chance because of old record i am getting above error.
有没有可能因为旧记录我得到了以上错误。
please help.请帮忙。
This is a feature of elasticsearch called dynamic mappings, when elasticsearch see a new field, it'll try to deduce the type of this field according to certain rules that you can find in their documentation https://www.elastic.co/guide/en/elasticsearch/reference/current/dynamic-field-mapping.html这是 elasticsearch 的一个特性,称为动态映射,当 elasticsearch 看到一个新字段时,它会尝试根据您可以在其文档中找到的某些规则来推断该字段的类型https://www.elastic.co/guide /en/elasticsearch/reference/current/dynamic-field-mapping.html
Your field timeStamp is mapped as long, and when you try to insert a date in this field it cause an exception.您的字段 timeStamp 被映射为很长,当您尝试在此字段中插入日期时,它会导致异常。
You have to re-index all of your data or save the timeStamp as long您必须重新索引所有数据或保存时间戳
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.