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

# Split long pages into smaller records

> Split long pages into smaller records by heading, section, paragraph, or another logical boundary.

export const Records = () => <Tooltip tip="A record is a searchable object in an Algolia index. Each record consists of named attributes." cta="Algolia records" href="/doc/guides/sending-and-managing-data/prepare-your-data#algolia-records">
    records
  </Tooltip>;

Content-heavy documentation pages can contain thousands of words under a single URL.
If you index a full page as one record, a query can match unrelated parts of the page and return a result that's too broad.

To improve relevance, split long pages into smaller records.
For example, create one record for each heading, section, paragraph, or another logical boundary.
Smaller records let Algolia match queries to the most relevant part of a page instead of treating the whole page as one large block of content.

When splitting content into records, preserve the page structure.
Include attributes such as the page title, section title, URL, and content.
These attributes let you distinguish page-level matches from section-level matches and send users directly to the relevant part of the page.

Splitting long pages also helps you stay within Algolia's [record size limits](/doc/guides/scaling/algolia-service-limits#application-record-and-index-limits).
Long documentation pages or knowledge base articles might be too large to fit into single <Records />.

<Info>
  If you're using the Algolia Crawler and a record exceeds its size limit,
  use the [`helpers.splitContentIntoRecords()`](/doc/tools/crawler/apis/configuration/actions#param-helpers-split-content-into-records) helper to split the page into smaller records.
</Info>

## Example records for a long page

Each record includes page-level and section-level attributes,
such as `page_id`, `title`, `section`, `url`, and `content`.
Page-level records can omit `section`.

```json JSON icon=braces theme={"system"}
[
  {
    "page_id": "indexing-long-documents",
    "title": "Split long pages into smaller records",
    "url": "https://www.algolia.com/doc/guides/sending-and-managing-data/prepare-your-data/how-to/indexing-long-documents",
    "content": "Content-heavy documentation pages can contain thousands of words under a single URL..."
  },
  {
    "page_id": "indexing-long-documents",
    "title": "Split long pages into smaller records",
    "section": "Example records for a long page",
    "url": "https://www.algolia.com/doc/guides/sending-and-managing-data/prepare-your-data/how-to/indexing-long-documents#example-records-for-a-long-page",
    "content": "Each record includes page-level and section-level attributes..."
  },
  {
    "page_id": "indexing-long-documents",
    "title": "Split long pages into smaller records",
    "section": "Deduplicate records in search results",
    "url": "https://www.algolia.com/doc/guides/sending-and-managing-data/prepare-your-data/how-to/indexing-long-documents#deduplicate-records-in-search-results",
    "content": "A single query might return more than one record from the same page..."
  }
]
```

## Deduplicate records in search results

A single query might return more than one record from the same page.
To show only the best matching record for each page, set [`attributeForDistinct`](/doc/api-reference/api-parameters/attributeForDistinct) to `page_id` and enable `distinct`.
Algolia groups records with the same `page_id` and returns the best matching record from each group.

For more information, see [Results deduplication with distinct](/doc/guides/managing-results/refine-results/grouping).
