How to add new type to an existing index using Elasticsearch 6.x high level java REST API


(Anjana Surendrababu) #1

How can I add a new type to an existing index using Elasticsearch 6.x high level java REST API?

I am using a PutMappingRequest , it adds the first type when I am trying to add the second type it says

Rejecting mapping update to [db] as the final mapping would have more than 1 type

Any help on this?


(Christian Dahlqvist) #2

Elasticsearch 6.x only supports a single type per index, so you can not do this. A workaround may be to add the type as a normal field and then filter on this.


(Anjana Surendrababu) #3

I am trying to index around 5 modules in my application, which may or may not have same properties. And I am trying to implement a global search here, like if I search for a word I want to return the results from all the 5 modules. Which will be a better approach for me? Having a custom type property and keeping everything in a single index or having separate indices for each modules


(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.