mock_items
table.shoes
, but the user typed in shoez
. The fuzzy_term
query can find search results that approximately match the query term while allowing for minor typos in the input.
Expected Response
ruining shoez
when searching for running shoes
. Because fuzzy_term
treats value
as a single token,
passing the entire phrase to fuzzy_term
will not yield any matches. Instead, match
should be used. match
finds documents where
any of the query’s tokens are a fuzzy match.
Expected Response
match
can be configured to match documents if all query tokens match.
Expected Response
description
and category
. The boolean
query can be used to query across multiple fields.
Expected Response
sho
. In this scenario,
the ngrams tokenizer can be used to convert documents into ngram tokens.
For the purpose of this example, let’s assume that we have an index called ngrams_idx
:
description
tokenized into n-grams, we can search for partial words.
Expected Response
hsoes
does not match shoes
, because the hso
token does not match any of the tokens of shoes
.
To match documents where any ngram token of the query matches, the match
query can again be used. Since we are looking for
exact ngram matches, the distance
parameter can be lowered to 0
.
Expected Response
paradedb.boolean
can be used to compose new, powerful queries.
We encourage you to use these functions to experiment with queries that satisfy your use case.