Hello, I have e-commerce store where I have generated automated tags for the my products. Each product can have approximately 100-120 tags on it. Now I would like to do match query and retrieve only specific tags from that products. I don't know how to store the tags for specific product. Hence I have stored it in an array. Here is the mapping
mappings": {
"properties": {
"product_name": {
"type": "text",
"store": true,
"analyzer": "autocomplete",
"search_analyzer": "autocomplete_search"
},
"tags": {
"type": "text",
"store": true,
"analyzer": "autocomplete",
"search_analyzer": "autocomplete_search"
}
}
}
They way I documents index are like this:
"_index": "product_details",
"_type": "_doc",
"_id": "2",
"_score": 1.0,
"_source": {
"tags": [
"black_color",
"wireless",
"amazon_deals"
],
"product_name": "alexa"
}
},
{
"_index": "product_details",
"_type": "_doc",
"_id": "1",
"_score": 1.0,
"_source": {
"tags": [
"bluetooth",
"wireless",
"best_deals"
],
"product_name": "handfree"
}
Now I can't not retrieve specific tags from the keywords type by the user. Is there any why to do it or any other way to store this type of data ?