In the query below I'll exclude all the words that contain "vegetable". Is there a way to create a separate query to get all of the excluded words?
{
"query": {
"match_phrase": {"words": "get"}
},
"aggs": {
"clusters": {
"terms": {
"field": "words",
"exclude": ".*vegetable.*",
}
}
}
}