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

# Sparse vector query

> Search LambdaDB using sparse vector representations from learned sparse retrieval models. Pass precalculated token-weight pairs for precise matching.

A sparse vector query executes search using sparse vector representations, typically generated by learned sparse retrieval models.
You must provide precalculated token-weight pairs as your query vectors, where each pair represents a term and its corresponding relevance score.

<Info>
  Currently, LambdaDB does not support built-in natural language processing models for automatic sparse vector generation.
</Info>

## Parameters

| Parameter   | Description                                    | Type   | Required |
| :---------- | :--------------------------------------------- | :----- | :------- |
| field       | The name of the vector field to search against | string | ✓        |
| queryVector | Query vector as token-weight pairs             | object | ✓        |

## Examples

### Token-based sparse vector query

```json theme={null}
{
  "sparseVector": {
    "field": "example_sparse_field",
    "queryVector": {
      "LambdaDB": 0.5,
      "awesome": 0.3,
      "AI": 0.2
    }
  }
}
```

### Index-based sparse vector query

If you prefer to use the index-based format with separate values and index arrays, you can specify index positions as keys in the queryVector object:

```json theme={null}
{
  "sparseVector": {
    "field": "example_sparse_field",
    "queryVector": {
      "10": 0.5,
      "45": 0.3,
      "234": 0.2
    }
  }
}
```
