Create a text filter for full-text search on text fields.
This is a convenience function that provides a fluent API for building text filters. Text filters support exact phrases, wildcard patterns, fuzzy matching, and tokenized search.
Text(field: string): __type| Name | Type | Description |
|---|---|---|
field* | string |
The name of the text field to filter on
// Exact phrase
const filter = Text("title").eq("wireless headphones");
// Wildcard search
const filter = Text("title").wildcard("*phone*");
// Fuzzy search (tolerates typos)
const filter = Text("description").fuzzy("blutooth");
// Tokenized word matching
const filter = Text("description").match("wireless bluetooth");