Hi,
when trying to expand mapping by adding a new field definition, mapping
gets updated (I get update_mapping in ES console) and I see new props
when retrieving mapping definition, but mapping update results in
response {"ok":true,"acknowledged":false}
What does it mean to have "ok":true, but "acknowledged":false?
Here are the steps to re-create:
- Create index
curl -XPUT 'http://localhost:9200/twitter/'
result: {"ok":true,"acknowledged":true}
- Put default mapping
curl -XPUT 'http://localhost:9200/twitter/tweet/_mapping' -d '
{
"tweet" : {
"properties" : {
"message" : {"type" : "string", "store" : "yes"}
}
}
}
'
result: {"ok":true,"acknowledged":true}
3a. Try to expand (first approach)
curl -XPUT 'http://localhost:9200/twitter/tweet/_mapping' -d '
{
"tweet" : {
"properties" : {
"message" : {"type" : "string", "store" : "yes"},
"newfield" : {"type" : "string", "store" : "yes"}
}
}
}
'
result: {"ok":true,"acknowledged":false}
3b. Try to expand (second approach, same steps 1. & 2.)
curl -XPUT 'http://localhost:9200/twitter/tweet/_mapping' -d '
{
"tweet" : {
"properties" : {
"newfield" : {"type" : "string", "store" : "yes"}
}
}
}
'
result: {"ok":true,"acknowledged":false}
In both cases (3a. and 3b.) mapping gets expanded ( update_mapping [tweet] in ES console) and I see a new field definition when retrieving mapping definition by
curl -XGET 'http://localhost:9200/twitter/tweet/_mapping' > mapping.txt
here is the props part of mapping:
"properties":{"message":{"omit_term_freq_and_positions":false,"index_name":"message","index":"analyzed","omit_norms":false,"store":"yes","boost":1.0,"term_vector":"no","type":"string"},"newfield":{"omit_term_freq_and_positions":false,"index_name":"newfield","index":"analyzed","omit_norms":false,"store":"yes","boost":1.0,"term_vector":"no","type":"string"}},
(for some reason I don't get nicely aligned mapping definition any more with 'get mapping')
Question: Am I trying to expand mapping correctly?
If not, what is the right way/syntax to expand mapping to add new field definition?
If yes, why is "acknowledged":false in result: {"ok":true,"acknowledged":false}
(I'm using latest stable release of ElasticSearch version 0.9.0.)
Tomislav