Skip to content
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

es.mapping.id populates wrong value #581

Closed
n0rb3rt opened this issue Oct 27, 2015 · 3 comments
Closed

es.mapping.id populates wrong value #581

n0rb3rt opened this issue Oct 27, 2015 · 3 comments

Comments

@n0rb3rt
Copy link

n0rb3rt commented Oct 27, 2015

Using Spark 1.5.1 and elasticsearch-spark 2.1.1 I'm setting the es.mapping.id to a field in my JSON called "feature_id". IDs are getting populated, but they don't match the value of the "feature_id" field in the document.

EsSpark.saveJsonToEs(
  rdd.map(_.toJson),
  "myindex/features",
  Map(
    "es.nodes" -> "myhost.com",
    "es.mapping.id" -> "feature_id"
  )
)
{
  "_index": "myindex",
  "_type": "features",
  "_id": "144136021837088505",
  "_score": 1,
  "_source": {
    "feature_id": 144136021837088500,
    ...
  }
}
@costin
Copy link
Member

costin commented Oct 27, 2015

Can you please post a sample doc? Is there another feature_id inside the document? Does it contain by any chance another 144136021837088500 - or is this number somewhere in an another document?
It looks like a bug but I'm trying to narrow down where do these numbers are coming from and thus what causes the bug to occur.

@n0rb3rt
Copy link
Author

n0rb3rt commented Oct 27, 2015

Actually I think this is a false alarm. I think the problem is my (Javascript) client incorrectly munging the Long value of feature_id. When I do it with curl everything looks good.

@n0rb3rt n0rb3rt closed this as completed Oct 27, 2015
@costin
Copy link
Member

costin commented Oct 27, 2015

@n0rb3rt Thanks for the update. Cheers!

@costin costin added the invalid label Oct 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants