Hello,
We're moving our search and faceting solution for our e-commerce
website from SOLR to elastic search, we're thrilled so far by the
speed of the solution but we're encountering a problem for which we
couldn't find a solution in the documentation or on the archives of
this mailing list.
We have a list of products for which we store multiple values:
id, color_id, color_title, size_ids, size_titles
We're using color_title and size_titles as Facets. color_title is a
unique value facet and size_titles is multiple.
Titles are used for sorting and displaying, so we need to be able to
match ids with values.
For the unique value facet (color) we used a script :
{
"query": {
"match_all": {}
},
"facets": {
"color_title": {
"terms": {
"field": "color_title",
"script" : "term + ';' + _source.color_id"
}
}
}
}
We tried to use the same principle for sizes but it doesn't work.
For a same term, we get multiple results corresponding to the list of
all the size_ids containing our size_title :
size_title; [size_ids]
47 ;[18, 26, 14, 15, 16, 17, 19, 20]
47 ;[21, 14, 15, 22, 16, 23, 24, 19, 25, 18, 26, 13, 20]
47 ;[27, 16, 17, 25, 52, 26, 14]
48 ;[14, 15, 16, 23, 17, 19, 20, 18, 26, 69]
Is there any way to get the exact size_id matching our size_title for
a multiple value facet?
Thanks in advance for your help and the good work you put into this
project.