Elasticsearch query to search word occurred as n times in document

Is it possible to query in elasticsearch if i want certain word to be occurred more than n times. For e.g. I want to search for word "Bill Gate" only if "Bill Gate" is present more than or equal to 3 times in a document.
I am storing field name as "content" which is type text that stores the full text of the story. Within this field I want to search for "Bill Gates" and return only those document that has "Bill Gates" word occurred more than or equal to 3 times.

I need to build query that will be generated dynamically based on no of occurrences user want to search for specific words within the content field.

Is this possible in elasticsearch. I tried searching lot on forum including stackoverflow but i couldnt find any solution/answers to my questions. I may be missing something here. Meanwhile am using elasticsearch version 6.2

Any help would be greatly appreciated. Please anyone!

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