I have a index that contains list of url as array
Schema:
{
"locations": {
"type": "keyword"
}
}
example document
{
"locations": [
"https://google.com",
"https://yahoo.com"
]
}
I want to use a transform to create a new index, which contains list of urls with number of occurrence.
I tried creating transform like this:
{
"pivot": {
"group_by": {
"user_id": {
"terms": {
"field": "userId"
}
}
},
"aggs": {
"locations": {
"terms": {
"field": "locations.raw",
"order": {
"_count": "desc"
}
}
}
}
}
// source and dest definition here
}
Transform was successfully created without error but resulting document always has locations as empty array. What am I missing here?