Gravatar for

Question by rloeb, Mar 17, 2016 12:07 AM

How to deactivate the thesaurus for a single Rest API query?

We would like to be turn the thesaurus on and off per REST API Query.

How can we accomplish this?

Also, what is the thesaurus property of the query for? Documentation says thesaurus name ("default" by default), but what does this mean? I see no reference anywhere to naming a thesaurus.


Gravatar for

Comment by Martin Laporte, Mar 17, 2016 4:16 AM

What product are you using exactly? Coveo for Sitecore? Coveo for Salesforce over a cloud org? Etc…

Gravatar for

Comment by gminero, Mar 17, 2016 10:09 AM

Sitecore I believe

1 Reply
Gravatar for

Answer by Jean-François L'Heureux, Mar 17, 2016 10:31 AM

Hi Randon,

The thesaurus option on the Coveo REST Search API query parameters is used to define which thesaurus to use in the Coveo Cloud platform (see Managing Query Pipeline Thesaurus).

With Coveo for Sitecore 3.0, your index is managed by the on-premise Coveo Enterprise Search 7 platform which have only one general thesaurus. Unfortunately, this thesaurus cannot be disabled per query like the one used in the Coveo Cloud platform.

However, there are certain exceptions when the CES7 thesaurus cannot be used. (see What Is the Thesaurus?)

I hope this helps,


Gravatar for

Comment by rloeb, Mar 17, 2016 10:59 AM


Yes, we are using Coveo for Sitecore 3.0 / CES 7

I tried adding a "dummy" NOT clause to the end of the q: property but it didn't work….

E.g. I created "dog" as a synonym for "tax". However, when I run q: dog NOT blahblahblah, I still get tax's matches (i.e. dog is getting expanded to tax).

Should that have worked, or is there some other innocuous clause I can add to effectively disable the thesaurus?

Thanks, Randy

Gravatar for

Comment by Jean-François L'Heureux, Mar 17, 2016 11:05 AM

The thesaurus is not used for the terms affected by the NOT operator only. It is still used for other parts of the query. So blah NOT dog would not exclude "tax".

Gravatar for

Comment by rloeb, Mar 17, 2016 1:37 PM

I figured as much. Note however the docs say this:

Example: When the word bob is set as a synonym of robert in the thesaurus, a query for bob becomes bob OR robert. However, when the query is bob NOT arthur, is not expanded and remains bob NOT arthur. (

I assumed it was a typo unless I'm just reading it wrong… (I think it should say arthur NOT bob)

My last idea was that because synonyms can be set per collection, that maybe I could somehow use a dummy collection that contains a provider for my existing index (i.e. the index lives in both collections) but not sure the rest api has any way to pick which collection to use? Honestly not that familiar with the collections concept so maybe that idea goes nowhere.

Well anyway let me know if you can think of anything, and I appreciate your help in confirming the issue.

Thanks, Randy

Ask a question