Match Query
We’re now ready to execute a basic text search query. We’ll look for matches wheredescription matches running shoes where rating is greater than 2.
Expected Response
||| is ParadeDB’s custom match disjunction operator, which means “find me all documents containing
running OR shoes.
If we want all documents containing running AND shoes, we can use ParadeDB’s &&& match conjunction operator.
Expected Response
BM25 Scoring
Next, let’s add BM25 scoring to the results, which sorts matches by relevance. To do this, we’ll usepdb.score.
Expected Response
Highlighting
Finally, let’s also highlight the relevant portions of the documents that were matched. To do this, we’ll usepdb.snippet.
Expected Response
Top K
ParadeDB is highly optimized for quickly returning the Top K results out of the index. In SQL, this means queries that contain anORDER BY...LIMIT:
Expected Response
Facets
Faceted queries allow a single query to return both the Top K results and an aggregate value, which is more CPU-efficient than issuing two separate queries. For example, the following query returns the top 3 results as well as the total number of results matched.Expected Response