Gravatar for

Question by colema18, Sep 8, 2015 12:08 PM

Omnibox Or Statement

I have a JavaScript Framework Omnibox Component but it appears that it is treating a search for "Apples or Oranges" as an AND instead of an OR. When looking at the REST request q: apples or oranges

Is there something I need to do to make OR clause get recognized?

2 Replies
Gravatar for

Answer by Jean-François L'Heureux, Sep 8, 2015 2:16 PM

The boolean operators should be written in uppercase for Coveo Enterprise Search to recognize them. Lowercase operators are treated as words by default (see Boolean Operators).

Note: The option to "recognize Boolean operators independently of the casing" in the documentation applies only to the Coveo .Net Front-End product and doesn't apply to the Coveo JavaScript Search Framework or the Coveo Search API REST endpoint. To implement a similar feature, you would have to search and replace the boolean operators in the query and replace them by their uppercase equivalent before executing the search query. EDIT: As pointed out by olamothe, the Coveo JavaScript Search Framework QueryBox component have an equivalent option named enableLowercaseOperators if used in the initialization options and data-enable-lowercase-operators if used in the markup (see enableLowercaseOperators).

Gravatar for

Comment by Jean-François L'Heureux, Sep 8, 2015 3:26 PM

I just corrected my answer to include olamothe's option.

Gravatar for

Answer by olamothe, Sep 8, 2015 3:15 PM

There is an option on the Querybox component (from which the omnibox inherits) to enable lowercase operators for the query.

Doc reference

Ask a question