Document Extraction (rtf:true) — Index PDFs, Word, Excel, and Other Files via the Ingestion API

Data Ingestion
API Feature

Document Extraction (rtf:true)

Index PDFs, Word documents, spreadsheets, presentations, and other rich document formats through the Data Ingestion API. Just add rtf:true to any document in your payload and point uri at the file. Opensolr fetches it, detects the real type from the file's bytes, extracts the text, reads the pictures and scanned pages inside it with OCR, and indexes it with all the same enrichment as any other document.

How It Works

Your App

POST with
rtf:true
+ document URI

→
Validate

Check URI, MIME type, file size

→
Fetch

Download file from URI

→
Extract

Detect format, extract plaintext

→
Enrich

Embeddings, sentiment, language, derived fields

→
Index

Searchable in Solr

The extracted text fills the text field automatically. You provide the title, description, and any other metadata you have. The full enrichment pipeline (embeddings, sentiment, language detection, derived fields) runs on the extracted text just like any other document.

Supported Formats

PDF
.pdf
Word
.docx / .doc / .rtf
Excel
.xlsx / .xls
PowerPoint
.pptx / .ppt
OpenDocument
.odt / .ods / .odp
Plain Text
.txt
HTML / CSV
.html / .csv
Images (OCR)
.png / .jpg / .gif / .webp / .tiff / .bmp

Example Payload

// Mix regular docs and RTF docs in the same batch:
{
  "email": "you@example.com",
  "api_key": "your_api_key",
  "core_name": "my_index",
  "documents": [
    {
      // Regular document — you provide the text
      "title": "Product Announcement",
      "description": "New features for Q1 2026",
      "text": "We are excited to announce...",
      "uri": "https://example.com/blog/announcement"
    },
    {
      // RTF document — text extracted from the PDF automatically
      "rtf": true,
      "title": "2025 Annual Report",
      "description": "Company financials and key metrics",
      "uri": "https://example.com/docs/annual-report-2025.pdf",
      "timestamp": 1735689600,
      "category": "Reports"
    },
    {
      // RTF document — Word file from an internal server
      "rtf": true,
      "title": "Employee Handbook",
      "description": "Company policies and procedures",
      "uri": "https://intranet.example.com/hr/handbook.docx",
      "og_image": "https://example.com/img/handbook-cover.png"
    }
  ]
}

What Happens

  1. The rtf:true flag is detected on the document
  2. The file at uri is fetched over HTTP/HTTPS
  3. The file type is detected from the actual content, never from the URL or the file name: a Word file served as a generic download, a spreadsheet with no extension, a PDF behind a document ID all work
  4. Text is extracted with a reader for that format: every page of a PDF; the paragraphs, tables, text boxes, headers and footers of a Word file; every sheet of a spreadsheet; every slide and its notes
  5. Pictures inside the document, scanned pages included, are read with OCR and their words are added to the text
  6. The extracted text populates the text field
  7. All other fields you provided (title, description, timestamp, etc.) are kept as-is
  8. The full enrichment pipeline runs: embeddings, sentiment, language detection, derived fields
  9. The document is pushed to your Solr index
Mix and match. You can combine regular documents and rtf:true documents in the same batch. Regular docs use the text you provide. RTF docs extract text from the file. Both go through the same enrichment pipeline.

Scanned Documents and Images (OCR)

On every plan, the extraction reads more than the text layer of a file:

  • A PDF is laid out page by page, each page under a Page N line: the page's own text first, then what was read in its pictures. A scanned PDF (pages that are only pictures) comes back as the reading of every page
  • Each picture of a PDF is read in the language of its page, detected automatically, among more than 100 languages; when no language is certain, English
  • A picture of a PDF with no text in it (a photo, a chart without labels) gets a short description of what it shows, in English, so it can be found by its meaning
  • The pictures inside a Word, Excel, PowerPoint or OpenDocument file are extracted and read, and their words are added at the end of text under an Images heading
  • An image file (PNG, JPEG, GIF, WEBP, TIFF, BMP) sent as the document is read whole
  • Pictures smaller than 300 pixels on a side are skipped (icons, bullets, logos), and a picture repeated on every page of a PDF is read once
What it costs. Each picture read counts 0.5 of an AI request and each picture described another 0.5; a picture read before, in any document, is free. The text of the pages themselves costs nothing. The OCR text is part of text: indexed, highlighted and vectorised exactly like typed text, no separate field to query.

Requirements for RTF Documents

  • rtf must be set to true (boolean, not a string)
  • uri must be a valid http:// or https:// URL pointing to the document file
  • The file must be publicly accessible (or accessible from the Opensolr server)
  • Maximum file size: the document size limit of your plan (the same limit as the web crawler's page size)
  • title and description are recommended but the text field will be extracted from the document, so at minimum you need rtf:true and uri
Security. Only the supported document formats are read. Executable files, scripts, archives and unknown file types are never opened: the document is indexed without text. The file type is verified from the actual file content, not from the URL extension.

If Extraction Fails

If the file cannot be fetched (bad URL, unreachable server, over the size limit of your plan), that specific document is marked as failed in the job results with a descriptive error message. Other documents in the same batch continue processing normally. A file that arrives but cannot be read (an unsupported format such as a zip archive, an empty or corrupted file) is not a failure: the document is indexed with an empty text field, with the title, description and every other field you sent, and the detected type in content_type.

Check the job status via the API or the Ingestion Queue page to see per-document results.

See it live: a live search over real PDFs whose words sit only inside pictures.

Need to index a large document library? Combine rtf:true with batch uploads for maximum efficiency.

Full API Docs