mongo-connector icon indicating copy to clipboard operation
mongo-connector copied to clipboard

Shouldn't the uniqueKey be used as "_id" for ElasticSearch ?

Open jasminas opened this issue 7 years ago • 3 comments

Hello, I am using mongo-connector version 2.5.1 with ElasticSearch 2.2. My MongoDB documents must have an "id" field that should be different from the internal primary key "_id". I want to have ElasticSearch "_id" field equal the "id" one from Mongo. From the docs it looked like the docManager..uniqueKey property was what I needed. I set it's value to "id", but nothing happened. ElasticSearch still takes Mongo's "_id" field into it's own. Is there any way to do this using the connector?

Thanks, Jasmina

jasminas avatar Mar 04 '17 16:03 jasminas

There's no way to do this with mongo-connector. The uniqueKey option was added for when Elasticsearch's _id is configured to use a different field, but that was deprecated in Elasticsearch 1.5: https://www.elastic.co/guide/en/elasticsearch/reference/1.5/mapping-id-field.html#_path.

ShaneHarvey avatar Mar 06 '17 18:03 ShaneHarvey

Hi Shane,

Is there any way to insert Mongo's "_id" field value into Elasticsearch's "id" filed (which is one of the fields of my ES index and that should go under _source)? So my requirement is just opposite of what its mentioned in the issue.

Thanks! Mohammad Salim

salimohammad avatar Mar 13 '17 19:03 salimohammad

+1

karimcitoh avatar Jul 18 '19 14:07 karimcitoh