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,

  1. create index

    curl -xput "http://localhost:9200/i1"
  2. create type 1

    curl -xput "http://localhost:9200/i1/t1/_mapping" -d {    "t1": {       "properties": {          "field1": {             "type": "string"          },          "field2": {             "type": "string"          }       }    } }'
  3. 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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -