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

# algolia compositions search

> Search a composition.

```txt Usage theme={"system"}
algolia compositions search <composition-id> <query> [flags]
```

## Examples

Search a composition with a query:

```sh icon=square-terminal theme={"system"}
algolia compositions search my-comp "running shoes"
```

Search with filters:

```sh icon=square-terminal theme={"system"}
algolia compositions search my-comp "shirt" --filters "brand:Nike"
```

Search with pagination:

```sh icon=square-terminal theme={"system"}
algolia compositions search my-comp "shirt" --hits-per-page 20 --page 2
```

## Flags

<ParamField body="--filters">
  Filter expression
</ParamField>

<ParamField body="--hits-per-page">
  Number of hits per page
</ParamField>

<ParamField body="--page">
  Page number
</ParamField>

## Output formatting flags

<ParamField body="--allow-missing-template-keys">
  If true, ignore errors in templates due to missing fields or map keys. This only applies to golang and jsonpath output formats.
</ParamField>

<ParamField body="-o, --output">
  Output format. One of: (json, jsonl, ndjson, jsonpath, jsonpath-as-json, jsonpath-file).
</ParamField>

<ParamField body="--template">
  Template string or path to a template file to use when --output=jsonpath, --output=jsonpath-file.
</ParamField>
