Gravatar for

Question by AKumar346, Mar 5, 2018 1:31 AM

CombinedData stats API giving top clicked document in response.


I need to show top 5 clicked pages from searched page, i checked your response on

The same i am trying but i found one URL is coming in response many times.

so i have two problems:

1) If content has changed from CMS but above api still gives the old documnetTitle name.

2) Can i get the document ID with the response


2 Replies
Gravatar for

Answer by Etienne, Mar 5, 2018 7:22 PM

If you have a ML TopClicks model, one thing you could try is to change the query to an empty query when there is no search results. By default the TopClicks model will boost the most clicked documents to the top if the query is empty.


> On an empty query, ART returns the most clicked documents during the data period of the model.

You could find a way to let the user know that his query returned no results and mention that you are instead showing the top clicked documents otherwise it may be confusing.

Please answer to this if the response given does not work instead of creating a newer question. It will help us track the original question -> answer marked as accepted.

Gravatar for

Comment by AKumar346, Mar 9, 2018 8:38 AM

Yes after query param empty, it's not repeating the same documentTitle.

For 2nd point, please suggest how can we get more properties in response like (documentID or document field names).

Gravatar for

Answer by eaubin, Mar 19, 2018 9:58 AM

Hi @Akumar

The UA API is not meant to be used as a normal index. I suggest you use Machine learning to get the most relevant results base on UA. ART is the way to go like mentioned by my colleague previously. If you want to build a custom no-result page to get the top 5 results then it could work. You can't have the Excerpt fields as it is generated at query time. In the case of a custom no-result page, you can do it in 2 queries, you get the top 5 documents, and you query the Search API to get the full results of these items.

Again, don't use the UA API in your regular search page, it's not meant for this.

Ask a question