Is there a way to pull statistics from the index?

Vote:
 

Hi there,

Episerver.Find v13.4.8

We have a requirement to build a UI in a search interface to show "Recent searches of yours", "Frequent searches of yours" and "Popular searches from other users" each being a list of suggested search queries. Although I'm aware the index has statistics of queries, I haven't seen anything about how to read this data for this given purpose. Knowing that the statistics are all there makes me reluctant to go build my own approach at this.

I believe this is a similar question to Find, tracking and get the statistics | Optimizely Developer Comm which concluded that it was a feature request - does anyone know if this feature request was added in v13.4.8 or if it will/has been added to a newer version?

Otherwise, has anyone come up with a nice solution to this? Or have alternative suggestions? FYI this is a Commerce website if that affects the approach.

Thanks for any advice,

Matt

#284430
Jul 26, 2022 9:39
Vote:
 

As that post has suggested call are made to the proxying code /EPiServer/Find/proxy/_stats/ endpoint which in turns just forwards those queries directly to the Search & Navigation instance which is just an elastic wrapper. Therefore those queries end up being translated to something like https://emea01.find.episerver.net/KEY/INDEX/_stats/ therefore it's totally possible even tho there's not .NET types and methods to handle every part of the stats area to just make direct calls and wrap them up in your own. The stats APIs follow https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-stats.html 

I just tried pulling fielddata out of one of my live indexes and it worked fine such as https://emea01.find.episerver.net/KEY/INDEX/_stats/fielddata 

#284441
Edited, Jul 26, 2022 11:52
Vote:
 

If you are calling from the front end however you should be able to just make your calls to /EPiServer/Find/proxy/_stats/ which will handle the translation of the proxy query to the elastic index and make those queries anyhow. Either direct or through the proxy so you don't need to load the key and index but you can they retrieve stats via the service or URL direct

#284442
Jul 26, 2022 11:55
Vote:
 

Thanks Scott, I'll have a play with the direct HTTP calls and see what we can get from that.

Still keen to hear if anyone with experience of using search suggestions based on queries - did you implement moderation? Did you have a process to check that queries actually get results?

#284465
Jul 26, 2022 22:22
Scott Reed - Jul 27, 2022 8:11
you can get auto complete and related queries which are both based on statistics https://docs.developers.optimizely.com/digital-experience-platform/v1.1.0-search-and-navigation/docs/search-statistics and you can pull out the searched values (as the admin shows) to use if you need. Note that any of these features based on statistics only record a hit if there's a result returned from the relevant search. E.g. someone searching for "test" in the system won't trigger that as a recorded statistical result if there's not results returned
* 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.