Reputation: 11
I have several documents like this:
text: "hello, I am your friend"
text: "hello, hello"
text: "everybody said: hello hello"
In full-text search, I want to count the number of times the search term appears, For example, a search for "hello" will return 5 results. I tried to use aggregate search and the result returned was the number of documents.
How to construct such a query? Thanks.
Upvotes: 1
Views: 297
Reputation: 5841
You can use explain API but you'd have to feed matching documents one by one. Look for the field with "description":"freq, occurrences of term within document"
Upvotes: 1