When supplying the “on” parameter to the join query, is it possible to just join on the document ID (_id meta field)? I’d like to avoid having to index the ID separately.
It is not possible to join on the _id meta field as this field does not have doc values enabled.
One alternative solution is to index the _id in a secondary field with doc values enabled, and use this field in the join.
Thanks for the clarification. More of an Elasticsearch question, but do you know if it is possible to do this when we are letting Elasticsearch automatically generate the IDs? Or do we need to generate these IDs on our end and pass them in?
Unfortunately, I don’t think it is possible to copy the
_id field to another field if the id is automatically generated by Elasticsearch.
See this recent Elasticsearch’s issue: https://github.com/elastic/elasticsearch/issues/41163
You would have to generate the id yourself.