Stworzyłem odwzorowania dla typu tweetb
w indeksie twitter
:null_value mapowanie w Elasticsearch
curl -XPUT http://www.mydomain:9200/twitter/tweetb/_mapping -d '{
"twitter": {
"mappings": {
"tweetb": {
"properties": {
"message": {
"type": "string",
"null_value": "NA"
}
}
}
}
}
}'
Następnie kładę jeden dokument:
curl -XPUT http://www.mydomain.com:9200/twitter/tweetb/1 -d '{"message": null}'
Potem starał się wstawione doc back:
curl -XGET http://www.mydomain:9200/twitter/tweetb/1
I ten, który powrócił:
{
"_index": "twitter",
"_type": "tweetb",
"_id": "1",
"_version": 2,
"found" : true,
"_source" : { "message": null }
}
Spodziewałem się "message" : "NA"
w polu _source
. Jednak wygląda na to, "null_value"
nie działa. Czy czegoś brakuje?
+1 dodatkowych informacji dostarczonych oprócz odpowiedzi. – Kaunteya