Hi there,
I have a query like this:
"query": {
"multi_match" : {
"fields" : ["form.*"],
"lenient": true,
"query" : "Ineligible"
}
}
This is essentially what I want, in that it finds all the records with "Ineligible" regardless of field, however I'm trying to figure out a way to get just the name of the fields, ideally with a count. Is this possible with ElasticSearch?
To reiterate, within the index, any of the text fields could possibly start with the word "Ineligible", is there a way to query ElasticSearch and have it return a count for the number of times each field has a value that starts with Ineligible?
I'm assuming this would involve an aggregation but I'm having trouble finding the appropriate one.
An example of what would be an ideal outcome would look like:
[
{
"key": "form.fieldA",
"doc_count": 15
},
{
"key": "form.fieldB",
"doc_count": 9
}
]
Thanks!