Algolia only applies highlighting to the first 50,000 characters of highlighted content for a search response (or 5,000 logograms for CJK languages). This global limit on the result set exists to keep response times fast, even when your results contain a lot of text.
If your records have very long text attributes or you highlight many attributes at once, this 50,000-character budget can be exhausted before Algolia has added highlight information for every hit. When that happens:
All hits are still returned in the response.
Some hits no longer include
_highlightResultdata, so they appear without highlighted terms.
This often shows up as highlighting “only” appearing on the first few hits.
To reduce the impact of this limit:
Limit which attributes you highlight.
Keep highlighting focused on the most important fields (for example, title and a short summary) instead of very long body content.Split very long content into smaller records.
For long pages or documents, break the content into logical chunks (sections, headings, paragraphs) and index each chunk as a separate record. This keeps individual attributes shorter and improves relevance for long content.
You can follow the “Index long pages” guidance here, when working with large documents to structure them into multiple records and avoid running into highlighting and record-size limitations.