Basic Usage

Matches all documents with a non-null value in the specified field. All matched documents get a BM25 score of 1.0.

Will error if the field has not been indexed as a fast field.

SELECT description, rating, category
FROM mock_items
WHERE id @@@ paradedb.exists('rating')
LIMIT 5;
field
required

Specifies the field within the document to search for the term.

This query is useful for filtering on NULL values inside a boolean query. For instance, the following code block finds all rows with description matching shoes that have a non-null rating.

SELECT description, rating, category
FROM mock_items
WHERE id @@@ paradedb.boolean(
  must => ARRAY[
    paradedb.term('description', 'shoes'),
    paradedb.exists('rating')
  ]
)
LIMIT 5;