3

After looking through the documentation, I am still unsure - If an upsert can be performed against elasticsearch with the Jest java client library?

Machavity
  • 30,841
  • 27
  • 92
  • 100
johnflan
  • 321
  • 4
  • 15

1 Answers1

2

I was able to do so by using the jsonBuilder:

new Update.Builder(XContentFactory.jsonBuilder().startObject().field("doc_as_upsert", true).startObject("doc").field("foo", "bar").string());
aviemzur
  • 171
  • 2
  • 5