Is there away to get a random word/words from a document?

I want to display some random words on the screen which are present in the document. I'm using Elasticsearch 7.12.

I don't think there's a way to natively do this, the closest thing is Random sampler aggregation | Elasticsearch Guide [8.2] | Elastic, but it's at a whole-document level.

Thank you for responding to my question, Mark. Can we get all the keywords from a document which is indexed? Later on we can use those keywords to perform a search query.

Not keywords, text(according to Elasticsearch). Can we get list of unique text terms available in a document?

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