London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

Most frequent searches

Vote:
0

Hi,

In EPiserver Statistics UI we have a Tab for Most Frequent Searches. How can I get those most frequest searches in my code?

I need to know Search phrase and number of queries.

Regards
/K

#122664
Jun 09, 2015 16:41
Vote:
0

I can't find any whay to do it, saidly.
I will add a feature request on it

#122673
Jun 10, 2015 8:39
Vote:
0

Theoratically it can be done as, but I am not sure. On top of that, not familiar with Elastic Search syntax also :(

string q = "ElasticSearchQueryToGetTheseDetails";
IQueriedSearch<ISearchContent> queriedSearch = SearchClient.Instance.UnifiedSearch(Language.None)
.For(q);
UnifiedSearchResults result = (queriedSearch).Take(20).GetResult(null, true);

Regards
Khurram

#122675
Jun 10, 2015 9:18
Vote:
0

+1, But what if i need that before version x.y.z :)
/K

#122681
Jun 10, 2015 9:52
Vote:
1

There is no way to do this through the API right now. Unified search can not be used since this statistics uses its own index. I think this might be added since it does seem to be a useful feature. For now, this can be achived using a rest request to the stats index like 

EPiServer/Find/proxy/_stats/query/top?from=2015-06-09T12%3A00%3A00Z&to=2015-06-10T12%3A00%3A00Z&interval=hour&size=25

which is what the Find UI does. The response would look like

{"status":"ok","total":1,"hits":[{"query":"alloy","count":1}]}

/Viktor

#122690
Edited, Jun 10, 2015 13:37
Vote:
0

Thanks Viktor, that was great to know!

#122693
Jun 10, 2015 13:53
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.