Gravatar for nicolas.a.slavik@accenture.com

Question by yonico, May 6, 2015 2:03 PM

How to get totalCount of results in CoveoSearch.ascx

Hi - I wanted to ask you how can I get the number results of the query success in CoveoSearch.ascx by jquery. thanks!

1 Reply
Gravatar for lbergeron@coveo.com

Answer by Luc Bergeron, May 6, 2015 2:27 PM

When handling the querySuccess event, you will find it in the event arguments.

Coveo.$('#search').on('querySuccess', function(e, args) {
    alert('Total number of results is: ' + args.results.totalCount);
});

You can find additional documentation here: https://developers.coveo.com/display/public/JsSearch/Events#Events-querySuccess https://developers.coveo.com/display/public/SearchREST/Query+Results

I hope this helps.

Ask a question