How i can change _type param in during import data into elasticsearch?

151 views Asked by At

I getting this

enter image description here

while import with schema.json description from postgres via pgsync

enter image description here

I want to override the value from _type: _doc to something else. Can you help me?

1

There are 1 answers

3
leandrojmp On BEST ANSWER

This is not possible, _type is a metadata field that was used until version 6.X to have different document types in the same index, this is not possible anymore.

In version 6.X you could have indices with a custom value for _type, but just one per index, on version 7.X the value for the _type field is _doc, and on the upcoming version 8.X this field and its related API won't exist anymore.

You can however create a new field named type and use any value you want, how you will do this depends on how you are ingesting your data.

For more information about the removal of types in elasticsearch you can check this official blog post and this part of the documentation.