Gravatar for nagasekhar.k@itcinfotech.com

Question by nagasekhar, Aug 19, 2014 8:14 AM

Coveo Search Results

Hi ,

Is there any way that we can get SearchResults Count using Model Obbject.(ex:-Model.PageNumberofPages for Page).

Regards, Naga

1 Reply
Gravatar for vseguin@coveo.com

Answer by Vincent Séguin, Aug 19, 2014 8:29 AM

Hi Naga,

Model is not aware of the search results itself, it's the configuration object besides your Sitecore layout. To access the search results count, you should use the JSUI and hook yourself on the querySuccess event.

Coveo.$('#search').on('querySuccess', function (e, data) {
  // use data.results.totalCount
});
Ask a question