Can I Update the Index structure?


(Sukesh) #1

Hi guys,

i have an index called facebook ,have some types called user1,user2,user3 in that with some data. Now i want to add the new type called user4 in the existing index . is it possible ? if it is please suggest me.


(Christoph) #2

You can add mappings to a new type by using the Put Mapping API. Be aware that you cannot change existing mappings. Also if you use the same fieldname in two different types, they need to have the same mapping (see section "Conflicts between fields in different types"). Elasticsearch 2.x will complain if you have a conflict and won't let you add the conflicting mapping, but Elasticsearch 1.x won't but might show unexpected and weird behaviour if you do so.


(Magnus B├Ąck) #3

See https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html.


(system) #4