I want a facet to only show specific terms. I've tried both a filter and a facet_filter
of type terms
, but both show other terms different from the given in the terms
filter.
As filter
{
"query": {
"filtered": {
"query": { "match_all": {} },
"filter": {
"terms": { "text": [ "bogota", "antioquia", "medellin", "cali", "barranquilla", "bucaramanga", "cucuta", "pasto", "manizales", "caldas", "santander" ] }
}
}
},
"facets": {
"dictionary": {
"terms": {
"field": "text",
"size": "10"
},
}
}
};
As facet filter
{
"query": {
"match_all": {}
},
"filter": {
"terms": { "text": [ "bogota", "antioquia", "medellin", "cali", "barranquilla", "bucaramanga", "cucuta", "pasto", "manizales", "caldas", "santander" ] }
},
"facets" : {
"dictionary" : {
"terms" : {
"field" : "text"
},
"facet_filter": {
"terms": { "text": [ "bogota", "antioquia", "medellin", "cali", "barranquilla", "bucaramanga", "cucuta", "pasto", "manizales", "caldas", "santander" ] }
}
}
}
};