ho creato una mappatura per un tipo tweetb
in un indice twitter
:mappatura null_value in elasticsearch
curl -XPUT http://www.mydomain:9200/twitter/tweetb/_mapping -d '{
"twitter": {
"mappings": {
"tweetb": {
"properties": {
"message": {
"type": "string",
"null_value": "NA"
}
}
}
}
}
}'
Poi, ho messo un documento:
curl -XPUT http://www.mydomain.com:9200/twitter/tweetb/1 -d '{"message": null}'
Poi, ho cercato di ottenere il inserito doc back:
curl -XGET http://www.mydomain:9200/twitter/tweetb/1
E che restituito:
{
"_index": "twitter",
"_type": "tweetb",
"_id": "1",
"_version": 2,
"found" : true,
"_source" : { "message": null }
}
Mi aspettavo "message" : "NA"
nel campo _source
. Tuttavia, sembra che "null_value"
non funzioni. Mi sto perdendo qualcosa?
+1 per ulteriori informazioni fornite oltre alla risposta. – Kaunteya