Reputation: 514
There is any way to get the search history in Elasticsearch. In this I want to get the search queries which are searched by customers in last one month.
Upvotes: 4
Views: 7761
Reputation: 733
Updating the answer for 2022 - you can do this now using Elastic AppSearch - this keeps a history of users who have searched for a particular text and you can query against this history - please look at this link
Upvotes: 1
Reputation: 217494
There's no such thing in ES, you need to log the queries yourself. However, there's a feature called slowlog which will log queries whose execution time goes above a certain threshold. You may lower that threshold to 0ms so that all queries get logged, but it is not meant for that purpose in the first place. You need to try it out and see how it works for you.
Upvotes: 8