I have an use case where I have bunch of images and i have multiple tags associated with each image. I have few attributes that are associated with each image and I would like to filter the suggestions based on few of those attributes. There could be more than one tags associated with each image.
id - tags - filter_a - filter_b
image1 - "tag1", "tag2", "tag3" - filter_a_val_1 - filter_b_val_1
image2 - "tag4", "tag5", "tag1" - filter_a_val_2 - filter_b_val_2
image3 - "tag2", "tag4", "tag1" - filter_a_val_1 - filter_b_val_3
Here are some questions
- How to make suggestions work with multi-valued fields. I can split them into multiple documents, but it makes an update to these multi-valued fields hard (initially 1 doc has N tags, then 1 doc has
- How do I handle duplicate tags across documents? I can do aggregation, but if we have a lot of duplicate tags then we have a risk of missing a lot of important suggestions from the shard response itself.
I am curious to hear from folks who were able to build autocomplete successfully on multi-valued fields and how did you handle the above two issues.