elastix
elastix copied to clipboard
Support for Document Partial Updates
I'd like to use Elastic's Update API to make partial or scripted update to an existing document. Any plans on adding this? thanks in advance!
Here's the code I used and I'll try to open a PR at some point:
uri = "#{Elastix.config(:uri)}/index_name/type/#{id}/_update"
body = %{
script: %{
inline: "ctx._source.tags.add(params.tag)",
lang: "painless",
params: %{
tag: %{
name: name,
}
}
}
}
{_, response} = Elastix.HTTP.post(uri, Poison.encode!(body))
Would be a good next feature! I'll milestone it for the next version.