For a new problem, I would add a RefinmentFilter for nested fields and inside key, value pairs.
Our query should looks like this:
POST search_de/_search
{
"size": 0,
"aggs": {
"attributes": {
"nested": {
"path": "techData"
},
"aggs": {
"key": {
"filter": {
"term": {
"techData.key": "COLOUR"
}
},
"aggs": {
"values": {
"terms": {
"field": "techData.valueKeyword"
}
}
}
}
}
}
}
}
This our sample data:
"techData": [
{
"name": "Leiterquerschnitt in mm²",
"valueKeyword": "0,14",
"key": "PL_DYN_QUERSCHNITT"
},
{
"name": "Außendurchmesser in mm",
"valueKeyword": "1,1",
"key": "PL_DURCHMESSERAUSSEN"
},
{
"name": "Aderfarbe",
"valueKeyword": "grün/gelb",
"key": "PL_COLOUR"
}
],
Is there a way to achive this with standard filters? If not, what is the easiest way to adapt SearchKit to our needed behavor?