'Sort by search phrase occurrences count Elasticsearch

I want to sort by occurrences count in Elasticsearch.

For example, I have some texts that contain Ludwig van Beethoven string and I want to sort them by these string occurrences count in the text.

Is this possible?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source