If you want to group, for example, “turquoise”, “ocean” and “sky” under “blue”, the recommended solution is to group them at indexing time. You can either add the group name as a separate attribute to filter on globally, or add both values in an array to make both the group and the individual value show up in the list.
For example, with the following dataset:
[ { "objectID": "1", "color": "turquoise" }, { "objectID": "2", "color": "ocean" }, { "objectID": "3", "color": "sky" } ]
You could create an additional attribute and use it for faceting:
[ { "objectID": "1", "color": "turquoise", "colorGroup": "blue" }, { "objectID": "2", "color": "ocean", "colorGroup": "blue" }, { "objectID": "3", "color": "sky", "colorGroup": "blue" } ]
Or you could list the individual colors and their groups so you can use them both for faceting:
[ { "objectID": "1", "color": [ "turquoise", "blue" ] }, { "objectID": "2", "color": [ "ocean", "blue" ] }, { "objectID": "3", "color": [ "sky", "blue" ] } ]