As you may know, the query pipeline conditions can be applied on a list of predefined variables like the
Browser or the
Language. It is also possible to specify your own context attribute if needed.
To leverage custom context attributes in the Query Pipeline
In your search page, use a snippet of code like the following to push the context information:
- In the Coveo Cloud Administration Console, build your condition in the query pipeline conditions:
- In the panel on the left, click Conditions.
- On the right sidebar, switch to the CODE view.
- Write your condition using in this format:
when $context[myContextualVariable] is "MY VALUE"
You can now use this condition on any pipeline rule that you want to apply it to.