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.
I can't find any whay to do it, saidly.I will add a feature request on it
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);
I like it when it is simple :)I added a request here: http://world.episerver.com/forum/developer-forum/Feature-requests/Thread-Container/2015/6/possible-to-get-information-about-most-frequent-searches-through-statistics-api-in-episerver-find/
+1, But what if i need that before version x.y.z :)/K
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
which is what the Find UI does. The response would look like
Thanks Viktor, that was great to know!