Here is my index
{
"mappings": {
"dynamic": false,
"fields": {
"profiles": {
"fields": {
"_id": {
"type": "objectId"
},
"firstName": {
"analyzer": "diacriticFolder",
"searchAnalyzer": "diacriticFolder",
"type": "string"
},
"lastName": {
"analyzer": "diacriticFolder",
"searchAnalyzer": "diacriticFolder",
"type": "string"
},
"pageName": {
"analyzer": "diacriticFolder",
"searchAnalyzer": "diacriticFolder",
"type": "string"
},
"type": {
"type": "string"
}
},
"type": "document"
}
}
},
"analyzers": [
{
"charFilters": [],
"name": "diacriticFolder",
"tokenFilters": [
{
"type": "icuFolding"
}
],
"tokenizer": {
"type": "keyword"
}
}
]
}
how can I return only the matched sub documents? using multi stage aggregation is not an option as I can not match matched sub documents without running the search query, which can only be ran once.