How to build Mapping for all indexes and types in ES 5.2.0

I understand how to build a mapping for any index and type. But, I want to have a field my_field_1 and my_field_2 which will not be analyzed for all the indexes and types that will be created in future.

PUT /address_index
{
"mappings":{
"address":{
"properties":{
"state":{
"type":"string",
"fields":{
"raw":{
"type":"string",
"index":"not_analyzed"
}
}
}
}
}
}
}
I also saw in one of the links on how to do for all the default. But, I am unable to add it for just the fields mentioned above.

I will be implementing this in Java. However, just DSL JSON would be good headstart.

Also, i am using java api BulKProcessor to add documents like :
bulkProcessor.add(new IndexRequest(indexName, type, id).source(json));

Will it impact my index mapping created earlier ?

I had posted it in SO , but dint get a satifactory reply. Sorry for duplication though.

Thanks
Abhishek.

You need to setup a template with a priority of 0 :slight_smile:

1 Like

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