Below is my query for getting distinct values of the fields.
{
"size": 0,
"aggs": {
"unique_pair": {
"multi_terms": {
"terms": [
{
"field": "username"
},
{
"field": "city"
}
]
}
}
}
}
I want to move the results to another index. I follow this How to sum of fields in elasticsearch and move another index
PUT _transform/person_city
{
"source": {
"index": "person",
"query": {
"match_all": {}
}
}
},
"pivot": {
"group_by": {
"username": {
"terms": {
"field": "username"
}
}
},
"aggregations": {
"unique_pair": {
"multi_terms": {
"terms": [
{
"field": "username"
},
{
"field": "city"
}
]
}
}
}
},
"dest": {
"index": "person_city"
}
}
But when i run the query i get unsupported aggregation type [multi_terms]
How can i get SQL DISTINCT Pair of Values in Elasticsearch . Like below,
SELECT distinct username, city from country_table
and move results to another index ?