> ## Documentation Index
> Fetch the complete documentation index at: https://docs.topk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# topk-js/query

[topk-js](/sdk/topk-js/index) / query

## Functions

### abs()

```ts theme={null}
function abs(expr: LogicalExpression): LogicalExpression;
```

Creates an absolute value expression.

**Parameters**

| Parameter | Type                                                                  |
| --------- | --------------------------------------------------------------------- |
| `expr`    | [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

***

### all()

```ts theme={null}
function all(exprs: LogicalExpression[]): LogicalExpression;
```

Evaluates to true if each `expr` is true.

**Parameters**

| Parameter | Type                                                                     |
| --------- | ------------------------------------------------------------------------ |
| `exprs`   | [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)\[] |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

***

### any()

```ts theme={null}
function any(exprs: LogicalExpression[]): LogicalExpression;
```

Evaluates to true if at least one `expr` is true.

**Parameters**

| Parameter | Type                                                                     |
| --------- | ------------------------------------------------------------------------ |
| `exprs`   | [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)\[] |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

***

### field()

```ts theme={null}
function field(name: string): LogicalExpression;
```

Creates a field reference expression.

**Parameters**

| Parameter | Type     |
| --------- | -------- |
| `name`    | `string` |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

***

### filter()

```ts theme={null}
function filter(expr: 
  | LogicalExpression
  | TextExpression): Query;
```

Creates a new query with a filter stage.

**Parameters**

| Parameter | Type                                                                                                                                        |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `expr`    | \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) \| [`TextExpression`](/sdk/topk-js/Namespace.query#textexpression) |

**Returns**

[`Query`](/sdk/topk-js/Namespace.query#query)

***

### literal()

```ts theme={null}
function literal(value: 
  | string
  | number
  | boolean
  | string[]
  | number[]
  | List): LogicalExpression;
```

Creates a literal value expression.

**Parameters**

| Parameter | Type                                                                                                             |
| --------- | ---------------------------------------------------------------------------------------------------------------- |
| `value`   | \| `string` \| `number` \| `boolean` \| `string`\[] \| `number`\[] \| [`List`](/sdk/topk-js/Namespace.data#list) |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

***

### match()

```ts theme={null}
function match(token: string, options?: MatchOptions): TextExpression;
```

Creates a text match expression.

**Parameters**

| Parameter  | Type                                                        |
| ---------- | ----------------------------------------------------------- |
| `token`    | `string`                                                    |
| `options?` | [`MatchOptions`](/sdk/topk-js/Namespace.query#matchoptions) |

**Returns**

[`TextExpression`](/sdk/topk-js/Namespace.query#textexpression)

***

### matchTokens()

```ts theme={null}
function matchTokens(tokens: (
  | string
  | MatchTokenInput)[], options?: MatchTokensOptions): TextExpression;
```

Creates a text match expression from multiple tokens with optional per-token weights.
Each token can be a string (with the default weight of 1.0) or a `MatchTokenInput` object.

**Parameters**

| Parameter  | Type                                                                                   |
| ---------- | -------------------------------------------------------------------------------------- |
| `tokens`   | ( \| `string` \| [`MatchTokenInput`](/sdk/topk-js/Namespace.query#matchtokeninput))\[] |
| `options?` | [`MatchTokensOptions`](/sdk/topk-js/Namespace.query#matchtokensoptions)                |

**Returns**

[`TextExpression`](/sdk/topk-js/Namespace.query#textexpression)

***

### max()

```ts theme={null}
function max(left: 
  | string
  | number
  | LogicalExpression, right: 
  | string
  | number
  | LogicalExpression): LogicalExpression;
```

Creates a MAX expression that returns the larger of two values.

**Parameters**

| Parameter | Type                                                                                             |
| --------- | ------------------------------------------------------------------------------------------------ |
| `left`    | \| `string` \| `number` \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |
| `right`   | \| `string` \| `number` \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

***

### min()

```ts theme={null}
function min(left: 
  | string
  | number
  | LogicalExpression, right: 
  | string
  | number
  | LogicalExpression): LogicalExpression;
```

Creates a MIN expression that returns the smaller of two values.

**Parameters**

| Parameter | Type                                                                                             |
| --------- | ------------------------------------------------------------------------------------------------ |
| `left`    | \| `string` \| `number` \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |
| `right`   | \| `string` \| `number` \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

***

### not()

```ts theme={null}
function not(expr: LogicalExpression): LogicalExpression;
```

Creates a logical NOT expression.

**Parameters**

| Parameter | Type                                                                  |
| --------- | --------------------------------------------------------------------- |
| `expr`    | [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

***

### select()

```ts theme={null}
function select(exprs: Record<string, 
  | LogicalExpression
  | FunctionExpression>): Query;
```

Creates a new query with a select stage.

**Parameters**

| Parameter | Type                                                                                                                                                                     |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `exprs`   | `Record`\<`string`, \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) \| [`FunctionExpression`](/sdk/topk-js/Namespace.query#functionexpression)> |

**Returns**

[`Query`](/sdk/topk-js/Namespace.query#query)

## Classes

### FunctionExpression

**`Internal`**

***

### LogicalExpression

**`Internal`**

**Methods**

##### abs()

```ts theme={null}
abs(): LogicalExpression;
```

Computes the absolute value of the expression.

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### add()

```ts theme={null}
add(other: 
  | number
  | LogicalExpression): LogicalExpression;
```

Adds another value to the expression.

**Parameters**

| Parameter | Type                                                                                 |
| --------- | ------------------------------------------------------------------------------------ |
| `other`   | \| `number` \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### and()

```ts theme={null}
and(other: 
  | boolean
  | LogicalExpression): LogicalExpression;
```

Computes the logical AND of the expression and another expression.

**Parameters**

| Parameter | Type                                                                                  |
| --------- | ------------------------------------------------------------------------------------- |
| `other`   | \| `boolean` \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### boost()

```ts theme={null}
boost(condition: 
  | boolean
  | LogicalExpression, boost: 
  | number
  | LogicalExpression): LogicalExpression;
```

Multiplies the scoring expression by the provided `boost` value if the `condition` is true.
Otherwise, the scoring expression is unchanged (multiplied by 1).

**Parameters**

| Parameter   | Type                                                                                  |
| ----------- | ------------------------------------------------------------------------------------- |
| `condition` | \| `boolean` \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |
| `boost`     | \| `number` \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)  |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### choose()

```ts theme={null}
choose(x: 
  | string
  | number
  | boolean
  | LogicalExpression, y: 
  | string
  | number
  | boolean
  | LogicalExpression): LogicalExpression;
```

Chooses between two values based on the expression.

**Parameters**

| Parameter | Type                                                                                                          |
| --------- | ------------------------------------------------------------------------------------------------------------- |
| `x`       | \| `string` \| `number` \| `boolean` \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |
| `y`       | \| `string` \| `number` \| `boolean` \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### coalesce()

```ts theme={null}
coalesce(other: 
  | number
  | LogicalExpression): LogicalExpression;
```

Coalesces nulls in the expression with another value.

**Parameters**

| Parameter | Type                                                                                 |
| --------- | ------------------------------------------------------------------------------------ |
| `other`   | \| `number` \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### contains()

```ts theme={null}
contains(other: 
  | string
  | number
  | LogicalExpression): LogicalExpression;
```

Checks if the expression contains another value.

**Parameters**

| Parameter | Type                                                                                             |
| --------- | ------------------------------------------------------------------------------------------------ |
| `other`   | \| `string` \| `number` \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### div()

```ts theme={null}
div(other: 
  | number
  | LogicalExpression): LogicalExpression;
```

Divides the expression by another value.

**Parameters**

| Parameter | Type                                                                                 |
| --------- | ------------------------------------------------------------------------------------ |
| `other`   | \| `number` \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### eq()

```ts theme={null}
eq(other: 
  | string
  | number
  | boolean
  | LogicalExpression): LogicalExpression;
```

Checks if the expression equals another value.

**Parameters**

| Parameter | Type                                                                                                          |
| --------- | ------------------------------------------------------------------------------------------------------------- |
| `other`   | \| `string` \| `number` \| `boolean` \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### exp()

```ts theme={null}
exp(): LogicalExpression;
```

Computes the exponential of the expression.

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### gt()

```ts theme={null}
gt(other: 
  | string
  | number
  | LogicalExpression): LogicalExpression;
```

Checks if the expression is greater than another value.

**Parameters**

| Parameter | Type                                                                                             |
| --------- | ------------------------------------------------------------------------------------------------ |
| `other`   | \| `string` \| `number` \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### gte()

```ts theme={null}
gte(other: 
  | string
  | number
  | LogicalExpression): LogicalExpression;
```

Checks if the expression is greater than or equal to another value.

**Parameters**

| Parameter | Type                                                                                             |
| --------- | ------------------------------------------------------------------------------------------------ |
| `other`   | \| `string` \| `number` \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### in()

```ts theme={null}
in(other: 
  | string
  | string[]
  | number[]
  | LogicalExpression
  | List): LogicalExpression;
```

Checks if the expression is in another value.

**Parameters**

| Parameter | Type                                                                                                                                                             |
| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `other`   | \| `string` \| `string`\[] \| `number`\[] \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) \| [`List`](/sdk/topk-js/Namespace.data#list) |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### isNotNull()

```ts theme={null}
isNotNull(): LogicalExpression;
```

Checks if the expression evaluates to a non-null value.

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### isNull()

```ts theme={null}
isNull(): LogicalExpression;
```

Checks if the expression evaluates to null.

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### ln()

```ts theme={null}
ln(): LogicalExpression;
```

Computes the natural logarithm of the expression.

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### lt()

```ts theme={null}
lt(other: 
  | string
  | number
  | LogicalExpression): LogicalExpression;
```

Checks if the expression is less than another value.

**Parameters**

| Parameter | Type                                                                                             |
| --------- | ------------------------------------------------------------------------------------------------ |
| `other`   | \| `string` \| `number` \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### lte()

```ts theme={null}
lte(other: 
  | string
  | number
  | LogicalExpression): LogicalExpression;
```

Checks if the expression is less than or equal to another value.

**Parameters**

| Parameter | Type                                                                                             |
| --------- | ------------------------------------------------------------------------------------------------ |
| `other`   | \| `string` \| `number` \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### matchAll()

```ts theme={null}
matchAll(other: 
  | string
  | string[]
  | LogicalExpression): LogicalExpression;
```

Checks if the expression matches all terms against the field with keyword index.

**Parameters**

| Parameter | Type                                                                                                |
| --------- | --------------------------------------------------------------------------------------------------- |
| `other`   | \| `string` \| `string`\[] \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### matchAny()

```ts theme={null}
matchAny(other: 
  | string
  | string[]
  | LogicalExpression): LogicalExpression;
```

Checks if the expression matches any term against the field with keyword index.

**Parameters**

| Parameter | Type                                                                                                |
| --------- | --------------------------------------------------------------------------------------------------- |
| `other`   | \| `string` \| `string`\[] \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### max()

```ts theme={null}
max(other: 
  | string
  | number
  | LogicalExpression): LogicalExpression;
```

Computes the maximum of the expression and another value.

**Parameters**

| Parameter | Type                                                                                             |
| --------- | ------------------------------------------------------------------------------------------------ |
| `other`   | \| `string` \| `number` \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### min()

```ts theme={null}
min(other: 
  | string
  | number
  | LogicalExpression): LogicalExpression;
```

Computes the minimum of the expression and another value.

**Parameters**

| Parameter | Type                                                                                             |
| --------- | ------------------------------------------------------------------------------------------------ |
| `other`   | \| `string` \| `number` \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### mul()

```ts theme={null}
mul(other: 
  | number
  | LogicalExpression): LogicalExpression;
```

Multiplies the expression by another value.

**Parameters**

| Parameter | Type                                                                                 |
| --------- | ------------------------------------------------------------------------------------ |
| `other`   | \| `number` \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### ne()

```ts theme={null}
ne(other: 
  | string
  | number
  | boolean
  | LogicalExpression): LogicalExpression;
```

Checks if the expression does not equal another value.

**Parameters**

| Parameter | Type                                                                                                          |
| --------- | ------------------------------------------------------------------------------------------------------------- |
| `other`   | \| `string` \| `number` \| `boolean` \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### or()

```ts theme={null}
or(other: 
  | boolean
  | LogicalExpression): LogicalExpression;
```

Computes the logical OR of the expression and another expression.

**Parameters**

| Parameter | Type                                                                                  |
| --------- | ------------------------------------------------------------------------------------- |
| `other`   | \| `boolean` \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### regexpMatch()

```ts theme={null}
regexpMatch(other: string, flags?: string): LogicalExpression;
```

Check if the expression matches the provided regexp pattern.

**Parameters**

| Parameter | Type     |
| --------- | -------- |
| `other`   | `string` |
| `flags?`  | `string` |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### sqrt()

```ts theme={null}
sqrt(): LogicalExpression;
```

Computes the square root of the expression.

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### square()

```ts theme={null}
square(): LogicalExpression;
```

Computes the square of the expression.

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### startsWith()

```ts theme={null}
startsWith(other: 
  | string
  | LogicalExpression): LogicalExpression;
```

Checks if the expression starts with another value.
Can be applied on a string field or a list of strings field.

```ts theme={null}
// Example:
import { field, startsWith } from "topk-js/query";
client.collection("books").query(
  filter(field("title").startsWith("The") | field("tags").startsWith("fiction"))
)
```

**Parameters**

| Parameter | Type                                                                                 |
| --------- | ------------------------------------------------------------------------------------ |
| `other`   | \| `string` \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### sub()

```ts theme={null}
sub(other: 
  | number
  | LogicalExpression): LogicalExpression;
```

Subtracts another value from the expression.

**Parameters**

| Parameter | Type                                                                                 |
| --------- | ------------------------------------------------------------------------------------ |
| `other`   | \| `number` \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |

**Returns**

[`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression)

##### toString()

```ts theme={null}
toString(): string;
```

Returns a string representation of the logical expression.

**Returns**

`string`

***

### Query

**`Internal`**

A query object that represents a sequence of query stages.

Queries are built by chaining together different stages like select, filter, topk, etc.
Each stage performs a specific operation on the data.

**Methods**

##### count()

```ts theme={null}
count(): Query;
```

Adds a count stage to the query.

**Returns**

[`Query`](/sdk/topk-js/Namespace.query#query)

##### filter()

```ts theme={null}
filter(expr: 
  | LogicalExpression
  | TextExpression): Query;
```

Adds a filter stage to the query.

**Parameters**

| Parameter | Type                                                                                                                                        |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `expr`    | \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) \| [`TextExpression`](/sdk/topk-js/Namespace.query#textexpression) |

**Returns**

[`Query`](/sdk/topk-js/Namespace.query#query)

##### limit()

```ts theme={null}
limit(k: number): Query;
```

Adds a limit stage to the query.

**Parameters**

| Parameter | Type     |
| --------- | -------- |
| `k`       | `number` |

**Returns**

[`Query`](/sdk/topk-js/Namespace.query#query)

##### select()

```ts theme={null}
select(exprs: Record<string, 
  | LogicalExpression
  | FunctionExpression>): Query;
```

Adds a select stage to the query.

**Parameters**

| Parameter | Type                                                                                                                                                                     |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `exprs`   | `Record`\<`string`, \| [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) \| [`FunctionExpression`](/sdk/topk-js/Namespace.query#functionexpression)> |

**Returns**

[`Query`](/sdk/topk-js/Namespace.query#query)

##### sort()

```ts theme={null}
sort(expr: LogicalExpression, asc?: boolean): Query;
```

Adds a sort stage to the query.

**Parameters**

| Parameter | Type                                                                  |
| --------- | --------------------------------------------------------------------- |
| `expr`    | [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |
| `asc?`    | `boolean`                                                             |

**Returns**

[`Query`](/sdk/topk-js/Namespace.query#query)

##### topk()

```ts theme={null}
topk(
   expr: LogicalExpression, 
   k: number, 
   asc?: boolean): Query;
```

Adds a top-k stage to the query.

**Parameters**

| Parameter | Type                                                                  |
| --------- | --------------------------------------------------------------------- |
| `expr`    | [`LogicalExpression`](/sdk/topk-js/Namespace.query#logicalexpression) |
| `k`       | `number`                                                              |
| `asc?`    | `boolean`                                                             |

**Returns**

[`Query`](/sdk/topk-js/Namespace.query#query)

***

### TextExpression

**Constructors**

**Constructor**

```ts theme={null}
new TextExpression(): TextExpression;
```

**Returns**

[`TextExpression`](/sdk/topk-js/Namespace.query#textexpression)

**Methods**

##### and()

```ts theme={null}
and(other: TextExpression): TextExpression;
```

Computes the logical AND of the expression and another text expression.

**Parameters**

| Parameter | Type                                                            |
| --------- | --------------------------------------------------------------- |
| `other`   | [`TextExpression`](/sdk/topk-js/Namespace.query#textexpression) |

**Returns**

[`TextExpression`](/sdk/topk-js/Namespace.query#textexpression)

##### or()

```ts theme={null}
or(other: TextExpression): TextExpression;
```

Computes the logical OR of the expression and another text expression.

**Parameters**

| Parameter | Type                                                            |
| --------- | --------------------------------------------------------------- |
| `other`   | [`TextExpression`](/sdk/topk-js/Namespace.query#textexpression) |

**Returns**

[`TextExpression`](/sdk/topk-js/Namespace.query#textexpression)

## Interfaces

### MatchOptions

Options for text matching.

This struct contains configuration options for text matching operations,
including field specification, weight, and matching behavior.

**Properties**

| Property                             | Type      | Description                |
| ------------------------------------ | --------- | -------------------------- |
| <a id="property-all" /> `all?`       | `boolean` | Whether to match all terms |
| <a id="property-field" /> `field?`   | `string`  | Field to match against     |
| <a id="property-weight" /> `weight?` | `number`  | Weight for the match       |

***

### MatchTokenInput

A token for match\_tokens

**Properties**

| Property                               | Type     | Description                           |
| -------------------------------------- | -------- | ------------------------------------- |
| <a id="property-token" /> `token`      | `string` | The token to match                    |
| <a id="property-weight-1" /> `weight?` | `number` | Weight for the term (defaults to 1.0) |

***

### MatchTokensOptions

Options for match\_tokens.

**Properties**

| Property                             | Type      | Description                |
| ------------------------------------ | --------- | -------------------------- |
| <a id="property-all-1" /> `all?`     | `boolean` | Whether to match all terms |
| <a id="property-field-1" /> `field?` | `string`  | Field to match against     |

***

### Term

**Properties**

| Property                              | Type     | Description                 |
| ------------------------------------- | -------- | --------------------------- |
| <a id="property-field-2" /> `field?`  | `string` | The field to match against. |
| <a id="property-token-1" /> `token`   | `string` | The token to match.         |
| <a id="property-weight-2" /> `weight` | `number` | The weight of the term.     |
