Skip to main content
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. Long documentation pages or knowledge base articles might be too large to fit into single .
If you’re using the Algolia Crawler and a record exceeds its size limit, use the helpers.splitContentIntoRecords() helper to split the page into smaller records.

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
[
  {
    "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 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.
Last modified on June 1, 2026