Hello
I am learning OpenSearch (using version 2.4.1)
I am trying to create an aggregate that will count (e.g. top 50) words (or terms/keywords) that a text (or keyword or …) field contains in a given data stream
I ran across something like
POST mydatastream/_search
{
"size": 0,
"aggs": {
"term_frequencies": {
"terms": {
"field": "message.keyword",
"size": 30
}
}
}
}
(message is mixed text/keyword) field
This works but it takes the complete document as ‘thing’ to count and not the individual words/terms/keywords
I also ran into
GET /.ds-mydatastream-000001/_mtermvectors
{
"ids": [..,...],
"parameters": {
"fields": ["message"],
"term_statistics": true,
"offsets":false,
"payloads":false,
"positions":false
}
}
That’s more what I want but it requires the ids to be specified (which also is not an option in my case)
Can someone point me in the right direction?
Tx!
Peter