Hello everybody,
Let's say I have the following mapping:
curl -X PUT "localhost:9200/test/map1/_mapping" -d '{
"map1" : {
"properties" : {
"user" : {"type" : "string"},
"message" : {"type" : "string", "null_value" : "na"},
"postDate" : {"type" : "date"},
"priority" : {"type" : "integer"},
"rank" : {"type" : "float"}
}
}
}'
and I post an arbitrary content to it (like user and message) and now put
again a field, which is not yet specified for the id, it is just added.
Any search queries work fine now.
If I change the content of one field already existing, the content of all
the other fields vanishes and only the replaced content remains.
Let's say, for id 1 I filled all fields and now want to replace "message"
without any change to the remaining fields "user", "postdate" etc.
First entry:
curl -XPUT 'localhost:9200/test/map2/1' -d '{
"user":"esuser",
"message":"esftw",
"postDate":"20111008"
}'
Replace :
curl -XPUT 'localhost:9200/test/map2/1' -d '{
"message":"esrulez",
}'
Any search now returns:
{
"_index" : "test",
"_type" : "map2",
"_id" : "1",
"_version" : 7,
"exists" : true, "_source" : { "message" : "esrulz" }
}
instead of
{
[...]
"exists" : true, "_source" : {
"user":"esuser",
"message":"esftw",
"postDate":"20111008"
}
}
What can I do?
Thx in advance