Gravatar for shirazi@rdacorp.com

Question by aga, Oct 27, 2015 4:05 PM

Manually trigger query from javascription

Hi

Im using coveo for sitecore and I need to manually trigger a query from javascript. Something like this:

Coveo.$('#search').coveoForSitecore('execute');

Thanks

2 Replies
Gravatar for shirazi@rdacorp.com

Answer by aga, Oct 27, 2015 4:21 PM

Nevermind, I found it

var queryController = Coveo.$("#search").coveo(Coveo.Controllers.QueryController).queryController; queryController.executeQuery();

Gravatar for jflheureux@coveo.com

Answer by Jean-François L'Heureux, Oct 27, 2015 9:13 PM

The recommended way of executing a query is using the global call exposed by the jQuery Extension:

Coveo.$('#search').coveo('executeQuery');

Source: https://developers.coveo.com/display/JsSearch/Query+Controller

Ask a question