您的类型不一致,在API调用中,类型为 my_type
curl -XPUT http://localhost:9200/my_index/_mapping/my_type
然后在JSON消息中变成 sale_test 。
具有一致的类型将解决您的问题:
curl -XPUT http://localhost:9200/my_index/_mapping/sale_test -d ' { "sale_test": { "properties": { "Client": {"type": "string", "index": "not_analyzed" }, "OfferRGU": { "type": "long" }, "SaleDate": { "type": "date", "format": "dateOptionalTime" }, "State": { "type": "string" } } } }'在这里,您既有 新索引 又有 新类型 :
curl -XGET http://localhost:9200/dgses/sale_test_river/_mapping
更正索引和类型给我:
curl -XGET http://localhost:9200/my_index/sale_test/_mapping?pretty{ "myindex" : { "mappings" : { "sale_test" : { "properties" : { "Client" : { "type" : "string", "index" : "not_analyzed" }, "OfferRGU" : { "type" : "long" }, "SaleDate" : { "type" : "date", "format" : "dateOptionalTime" }, "State" : { "type" : "string" } } } } }}


