Gravatar for david_tobin@bose.com

Question by dave tobin, Apr 17, 2015 1:22 PM

(JavaScript Framework/using .NET api)Queries with no results generates "Your query has an error: QueryException1" error message

When a query returns no results, the JavaScript search page generates the following error "Your query has an error: QueryException1" instead of gracefully informing that the query has no results.

Note: We're using the JavaScript search framework, but pointing to the .NET api.

1 Reply
Gravatar for mlaporte@coveo.com

Answer by Martin Laporte, Apr 20, 2015 3:34 AM

Query exception typically occur when something is invalid in the query. What is being sent as the q, aq and cq parameters when the browser calls the REST API?

Gravatar for david_tobin@bose.com

Comment by dave tobin, Jun 30, 2015 3:55 PM

So… We're digging back into this one after a bit, and I'm not sure I know how to get at the variables you're asking for.

What I do know is that when I query for something which I know has results, it works as expected, but when I search for something which has no results, it doesn't give me a "no results" message, but instead returns the exception error.

Gravatar for mlaporte@coveo.com

Comment by Martin Laporte, Jul 2, 2015 5:04 AM

In Chrome, open the developer tools (F12) and look for the request made when hitting the Search button. Inspecting this request should show you the values for the q, aq and cq parameters.

Gravatar for david_tobin@bose.com

Comment by dave tobin, Jul 24, 2015 4:46 PM

Okay so I got the following:

aq is "undefined"

cq is "@syssource=Design Guidelines AND (@sysfiletype=PDF OR @sysfiletype=XLS)"

q is q: "alphabet"

Q appears to be what I typed in the search box, and CQ is the tab query expression.

Again, this error only occurs when the user searches for something for which there are no results.

Ask a question