Creating a mapping for an existing index with a new type in elasticsearch -
i found article on elasticsearch's site describing how 'reindex without downtime', that's not acceptable every time new element introduced needs have custom mapping (http://www.elasticsearch.org/blog/changing-mapping-with-zero-downtime/)
does know why can't create mapping existing index new type in elasticsearch? type doesn't exist yet, why not? maybe i'm missing , possible? if so, how can achieved?
thanks, vladimir
here simple example create 2 type mapping in index, (one after another)
i've used i1 index , t1 , t2 types,
create index
curl -xput "http://localhost:9200/i1"
create type 1
curl -xput "http://localhost:9200/i1/t1/_mapping" -d { "t1": { "properties": { "field1": { "type": "string" }, "field2": { "type": "string" } } } }'
create type 2
curl -xput "localhost:9200/i1/t2/_mapping" -d' { "t2": { "properties": { "field3": { "type": "string" }, "field4": { "type": "string" } } } }'
now looking @ mapping( curl -xget "http://localhost:9200/i1/_mapping"
), seems working.
hope helps!!
Comments
Post a Comment