Din type er ikke konsekvent, i API-kaldet er typen my_type
curl -XPUT http://localhost:9200/my_index/_mapping/my_type
så bliver det sale_test i JSON-meddelelsen.
At have en konsistent type vil løse dit problem:
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" }
}
}
}'
Her har du både et nyt indeks og en ny type :
curl -XGET http://localhost:9200/dgses/sale_test_river/_mapping
Korrigering af indeks og type giver mig:
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"
}
}
}
}
}
}