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

# Control content length

> How to cap how much of a document's content Search returns, or disable content entirely.

Set `fields.content` to `true`, `false`, or an object with
`max_characters_per_result` to cap how much content each result returns.

The examples below cap content at 500 characters per result.

<CodeGroup>
  ```python Python theme={null}
  from seltz import Seltz

  client = Seltz()

  response = client.search(
      "climate change",
      fields={"content": {"max_characters_per_result": 500}},
  )

  for document in response.documents:
      print(document.url)
      print(document.content)
  ```

  ```typescript TypeScript theme={null}
  import { Seltz } from "seltz";

  const client = new Seltz();

  const result = await client.search({
    query: "climate change",
    fields: { content: { maxCharactersPerResult: 500 } },
  });

  for (const doc of result.documents) {
    console.log(doc.url);
    console.log(doc.content);
  }
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.seltz.ai/v1/search \
    -H "x-api-key: $SELTZ_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"query": "climate change", "fields": {"content": {"max_characters_per_result": 500}}}'
  ```
</CodeGroup>

### Sample response

In the response below, `content` is limited to 500 characters. This truncates the article contents mid-sentence.

```json theme={null}
{
  "documents": [
    {
      "url": "https://www.climate-court.com/post/pakistan-fulfils-climate-pledge-establishes-climate-change-authority",
      "content": "# Pakistan Fulfils Climate Pledge: Establishes Climate Change Authority\n\nPakistan established its first ‘Climate Change Authority’, as required under Section 5\\(1\\) of the Climate Change Act 2017\\. Under Section 5\\(1\\), the Climate Change Authority should have been established by the “minister-in-charge of the Federal Government”\\. More recently, a bench of the Supreme Court, comprising three Justices, ordered the establishment of the Climate Change Authority\\. The Supreme Court order followed a",
      "published_date": "2024-05-27T12:09:04Z"
    }
  ]
}
```

See the [Search API Reference](/api-reference/search) for the full spec —
range, default, and validation error.

## Get content and snippets together

`fields` selects `content` and `snippets` independently, so request both, each
with its own ceiling, in the same call. See [Get
snippets](/search/guides/get-snippets) for the options `snippets` accepts.

<CodeGroup>
  ```python Python theme={null}
  response = client.search(
      "climate change",
      fields={
          "content": {"max_characters_per_result": 500},
          "snippets": {"max_snippets_per_result": 3},
      },
  )
  ```

  ```typescript TypeScript theme={null}
  const result = await client.search({
    query: "climate change",
    fields: {
      content: { maxCharactersPerResult: 500 },
      snippets: { maxSnippetsPerResult: 3 },
    },
  });
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.seltz.ai/v1/search \
    -H "x-api-key: $SELTZ_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"query": "climate change", "fields": {"content": {"max_characters_per_result": 500}, "snippets": {"max_snippets_per_result": 3}}}'
  ```
</CodeGroup>

## Next steps

* [Get snippets](/search/guides/get-snippets) — Retrieve a document's highest-scoring passages, and tune how many you get
* [Process results](/search/guides/process-results) — Working with `Document` fields client-side
* [Search API Reference](/api-reference/search) — Full request and response specification
