Skip to content

Disable _id.path by default #5558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
clintongormley opened this issue Mar 26, 2014 · 2 comments
Closed

Disable _id.path by default #5558

clintongormley opened this issue Mar 26, 2014 · 2 comments

Comments

@clintongormley
Copy link
Contributor

If you index a document like this:

POST /test/test
{ "foo": "bar", "_id": 2 }

it will throw an exception saying:

Provided id [upGeHLkQQv-aclC7mF6EWQ] does not match the content one [2]

In other words, it is using a path for the _id field, even though we haven't specified one, and there is no way to disable this.

I think that we should only do this check if the path parameter on the _id mapping is explicitly set.

@Diolor
Copy link

Diolor commented May 21, 2014

Related, in 1.1.1.

If you index a document like:

POST test/test
{
  "_id": {
    "$oid": "5303daa1c36b445138605a0c"
  },
  "event_id": {
    "$oid": "537c2a0ebb20c7336f5e4aca"
  },
  "start_date": "2014-05-24T20:00:00-04:00",
  "country": "Canada"
}

The auto-generated mapping will be:

{
  "test": {
    "mappings": {
       "test": {
          "properties": {
             "$oid": {
                "type": "string"
             }
          }
       }
    }
  }
}

It will normalize the _id field and will ignore the other fields.

@clintongormley
Copy link
Contributor Author

Closing in favour of #6730 and #9059

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants