How to index _id field using templates

(Yash Datta) #1

Hi all,

For my use case I index documents and supply unique ids based on my data. In the queries, I want to retrieve documents based on a list of ids + some other filters. Currently, we are using the ids query combined with the filters. The problem is the list of ids can be large. I was thinking maybe I can get some speedup by indexing the _id field and using a terms query instead. But I found no way to index the field. Is it still supported ?

I used the following and got _id is not configurable:

PUT at /index

"mappings": {
"default": {
"_id": {
"index": "not_analyzed"

(system) #2