ES version 6.8.12
我想将所有类型Map到索引中的给定字段,它应该存储所有类型的数据,而不是绑定到特定类型。当字符串存储在长类型字段中时,我面临问题。
[WARN ] 2020-09-14 06:34:36.470 [[main]>worker0] elasticsearch - Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>"5f4632bab98bdd75a267546b", :_index=>"cdrindex", :_type=>"doc", :routing=>nil}, #<LogStash::Event:0x38a5506>], :response=>{"index"=>{"_index"=>"cdrindex", "_type"=>"doc", "_id"=>"5f4632bab98bdd75a267546b", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse field [caller_id_number] of type [long] in document with id '5f4632bab98bdd75a267546b'", "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"For input string: \"Anonymous\""}}}}}
1条答案
按热度按时间jhkqcmku1#
那你得选一个
text
或者keyword
数据类型。在Map中,需要设置
caller_id_number
将数据类型显式地设置为上述类型之一,而不是让elasticsearch为您决定。例如:
请注意,如果要自动设置某些字段的Map,可以利用动态Map:
在上面的动态Map中,所有字段都以
caller_
将自动Map为text
而specific_field
将Map为long
...