How to Create Mapping to Aggregate on Strings in an Array

I have the following JSON structure (on the top level of my docs) and my question is how do I set my mapping up so that I can aggregate on keyphrases.terms. I know I could recreate the data and create keyphrase objects consisting of the terms and the corresponding weights and use a nested query, but I am trying to avoid having to do that. Any help would be appreciated. Thanks.

Kevin

"keyphrases": {
"terms": [
"account",
"account_log",
"birth_niagara_falls",
"book_download",
"canadian_football"
],
"weights": [
1.0,
1.0,
1.0,
1.0,
1.0
]
}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.