Current token (VALUE_TRUE) not numeric, can not use numeric value accessors

In mysql, the status field type is tinyint, but when retrieved from jdbc, it becomes boolean, with only true and false
This status field has several values, not only 0 and 1, but also 2.My configuration is:

{
"template": "*",
"settings": {
"index.refresh_interval": "5s"
},
"mappings": {
"doc": {
"properties": {
"name": {
"type": "text",
"analyzer": "ik_max_word",
"search_analyzer": "ik_max_word"
},
"status": {
**"type": "byte" **
** }**
}
}
}
}
logstash error:

Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>"175", :_index=>"goods", :_type=>"doc", :_routing=>nil}, #LogStash::Event:0x1cb52cc8], :response=>{"index"=>{"_index"=>"goods", "_type"=>"doc", "_id"=>"175", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse [status]", "caused_by"=>{"type"=>"json_parse_exception", "reason"=>"Current token (VALUE_TRUE) not numeric, can not use numeric value accessors\n at [Source: org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper@5bf39ccc; line: 1, column: 119]"}}}}}

Does anyone know this?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.