Splitting and re-indexing documents
Choose how each document is split into passages, preview the split before you upload, and re-index a document with different settings.
Before a document can be searched it is split into passages, and each passage is embedded. How it is split changes what search finds: small passages are precise, large ones carry more context. You can choose the split for each document, not only for a whole collection.
Choosing the split
When you upload files or add a URL, How to split offers two options:
- Use the default. If you add the file to exactly one collection, that collection's chunking settings apply. Otherwise the standard splitter is used (about 1,800 characters per passage).
- Choose for this upload. Pick a strategy and size for these documents only.
| Strategy | What it does | When to use it |
|---|---|---|
Equal-sized passages (fixed) | Cuts the text into passages of the same size. | Most documents. |
Overlapping passages (sliding_window) | Equal passages that share a few words with their neighbours. | Text where an answer often straddles a cut. |
Split where the topic changes (semantic) | Finds natural breaks between topics. | Long documents that mix topics. It uses a few embedding calls. |
Passage size is in words, from 100 to 2,000 (512 if you leave it empty). Overlap applies only to overlapping passages, and must be smaller than the passage size.
Settings you choose win
Settings chosen for an upload apply to that document alone and win over the collection's defaults. A collection's defaults only fill in uploads that do not choose their own, and only when the upload goes into exactly one collection.
Preview before you upload
With one file selected, Preview the split shows how many passages you would get, their sizes, and the first few, without storing anything. Try a size, look at the passages, and adjust before you upload.
Re-index a document
Open a document and choose Re-index with different settings. The preview shows the new split next to how the document is split now. When you re-index:
- Every new passage is embedded before anything changes, then the old passages are swapped for the new ones in one step. If something fails, the document is left exactly as it was.
- Collections, category and access settings stay.
- Every passage is replaced, including ones you edited by hand. If any passage was corrected, you are asked to confirm first.
Each document keeps its extracted text so it can be re-indexed without uploading the file again. Documents indexed before this was kept are rebuilt from their passages, so overlapping passages may repeat a few words; the preview says so.
Documents added from a website or by a sync cannot be re-indexed here, because their pages cannot be put back together. Add the URL again with the settings you want.
From the API
Send indexing with an upload, a file or URL job, and use the preview and re-index endpoints:
POST /v1/documents { "fileBase64": "...", "fileName": "policy.pdf", "indexing": { "strategy": "fixed", "chunk_size": 300 } }
POST /v1/documents/indexing/preview { "document_id": "...", "indexing": { "strategy": "sliding_window", "chunk_size": 300, "chunk_overlap": 50 } }
POST /v1/documents/{id}/reindex { "indexing": { "strategy": "fixed", "chunk_size": 200 }, "confirm_replace_edits": false }The preview takes file_base64 and file_name instead of document_id to preview a file you have not uploaded. A document's indexing field reports how it was split and where the settings came from: upload, collection or built_in. See the OpenAPI spec for the full request and response shapes.