Use existing field as identifier in elasticsearch

Just started using elasticSearch today. I was wondering if it is possible to set some kind of global parameter to use a specific field inside the document as an identifier always?

My JSON documents will always have their own unique identifier

{ "Record ID": "a06b0000004SWbdAAG", "System Modstamp": "01/31/2013T07:46:02.000Z", "body": "Test Body" } 

Here, I would like to use Record ID as the ID field.

Hello

+6
source share
1 answer

You want to use the path setting, see the docs here:

http://www.elasticsearch.org/guide/reference/mapping/id-field/

in particular, something like this should work in your display:

 { "your_mapping" : { "_id" : { "path" : "Record ID" } } } 

I have never tried to split variable names. You may want to hide or underline them if you encounter strangeness.

+2
source

Source: https://habr.com/ru/post/945436/


All Articles