Say I have a tag type in an ElasticSearch index with the following mapping:
{ "tag": { "properties": { "tag": {"type": "string", "store": "yes"}, "aliases": {"type": "string"} } } }
Each entry is a tag and an array of aliases for that tag. Here is an example:
{ "word": "weak", "aliases": ["anemic", "anaemic", "faint", "flimsy"] }
From time to time, I want to add new tags with their aliases and add new aliases to existing tags.
Adding new tags with their aliases is easy, it's just a new document. However, how can I add new aliases to existing tag words in a reasonable way?
I know that I can just search for a tag word, get its document, look for whether an alias will already exist in the array of aliases, if not add it, except for saving. However, this does not seem like a good solution.
Is there a way to do a bulk update?
Doron
source share