Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to perform an ElasticSearch upsert with Jest

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

like image 835
johnflan Avatar asked Dec 29 '25 20:12

johnflan


1 Answers

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());
like image 126
aviemzur Avatar answered Jan 02 '26 14:01

aviemzur



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!