I want a unique list of values from arrays of strings across all documents.
Example documents:
{
"_index": li",
"_type": "profile",
"_id": "tqvatGQBhAqGE7-_7pdF",
"nonarrayfield":"person A",
"attributes": [
"blah blah 123",
"112358",
"quick brown fox"
]
},
{
"_index": "li",
"_type": "profile",
"_id": "hqvatGQBhAqGE7-_7pRE",
"nonarrayfield":"person B",
"attributes": [
"blah blah 123",
"00000",
"California"
]
}
What I want is a unique list of attributes:
- "blah blah 123"
- "112358"
- "quick brown fox"
- "00000"
- "California"
When I try a basic aggregation query, I get "Error: 400 - all shards failed":
'{
"aggs":{
"aggregation_name":{
"terms":{"field":"attributes"}
}
}
}'
When I do the same thing on a non-array field, the query is successful:
'{
"aggs":{
"aggregation_name":{
"terms":{"field":"nonarrayfield"}
}
}
}'