I'm attempting to use the new update function and attachment plugin to
update a specific file object with the contents of the attachment. My
mapping looks like this:
where "files" is an array of file objects. I've verified the following
works:
But I'd like to do something like ctx._source.files[fileID].content =
content to update a specific file object by it's fileID property. I'm
flexible on changing my mapping at this point in order to get this to work.
The best way I can think about is with a more complex script, where you
have the file id on each file array element (based on the mappings, it
looks like you do), iterate through the files, find the ones that match the
file id, and then update its content.
I'm attempting to use the new update function and attachment plugin to
update a specific file object with the contents of the attachment. My
mapping looks like this:
But I'd like to do something like ctx._source.files[fileID].content =
content to update a specific file object by it's fileID property. I'm
flexible on changing my mapping at this point in order to get this to work.
Great. Is there an example of what that looks like?
On Friday, March 16, 2012 12:59:27 PM UTC-4, kimchy wrote:
The best way I can think about is with a more complex script, where you
have the file id on each file array element (based on the mappings, it
looks like you do), iterate through the files, find the ones that match the
file id, and then update its content.
I'm attempting to use the new update function and attachment plugin to
update a specific file object with the contents of the attachment. My
mapping looks like this:
But I'd like to do something like ctx._source.files[fileID].content =
content to update a specific file object by it's fileID property. I'm
flexible on changing my mapping at this point in order to get this to work.
Great. Is there an example of what that looks like?
On Friday, March 16, 2012 12:59:27 PM UTC-4, kimchy wrote:
The best way I can think about is with a more complex script, where you
have the file id on each file array element (based on the mappings, it
looks like you do), iterate through the files, find the ones that match the
file id, and then update its content.
I'm attempting to use the new update function and attachment plugin to
update a specific file object with the contents of the attachment. My
mapping looks like this:
But I'd like to do something like ctx._source.files[fileID].**content =
content to update a specific file object by it's fileID property. I'm
flexible on changing my mapping at this point in order to get this to work.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.