Query strings can be combined using SQL AND and OR operators. To combine query builder functions, see the boolean query.

Multiple Terms

AND and OR can be used to combine and filter multiple terms.

SELECT description, rating, category
FROM mock_items
WHERE description @@@ 'keyboard' OR category @@@ 'toy';

If multiple terms are passed into the same query string, they are ORed together by default.

SELECT description, rating, category
FROM mock_items
WHERE description @@@ 'keyboard headphones';

Not Term

- omits results that contain a specific term. The following query finds documents that match shoes or running but not white.

SELECT description, rating, category
FROM mock_items
WHERE description @@@ '(shoes running -white)';