Making PDF Content Searchable in Drupal 11 with Solr and Tika

Turning Static PDFs into Searchable Knowledge in Drupal 11
Pierre Bamin on Unsplash

Part 3 of the ongoing Automated Librarian series sees Ron Ferguson move beyond importing eBooks into Drupal 11 and tackle the real challenge: making thousands of PDF pages searchable. In a Drupal Odyssey post, he shows that while Drupal’s database search can index filenames and metadata, it remains blind to the actual text in binary files unless paired with the right search stack.

Ron explains how Apache Tika extracts text and hidden metadata from PDFs and hands it to Apache Solr for indexing, enabling deep-text search beyond filenames or basic metadata. Using Drupal’s Search API and the Search API Attachments module, he configures extraction through the “Solr Extractor” method, offloading processing to Solr’s Tika pipeline rather than the web server. This approach keeps CPU usage low while handling large documents efficiently.

He maps both the Title and the extracted text as Fulltext fields and applies weighted boosts to influence relevance, prioritising title matches with a boost value of 8.0 over body content set to 5.0. Within Views, he exposes the Fulltext search filter and switches the parse mode to “Direct query,” enabling operator-based searches such as excluding keywords. The result is precise retrieval of passages buried deep within multi-page PDFs, turning a static media library into a functional search index.

Disclosure: This content is produced with the assistance of AI.

Disclaimer: The opinions expressed in this story do not necessarily represent that of TheDropTimes. We regularly share third-party blog posts that feature Drupal in good faith. TDT recommends Reader's discretion while consuming such content, as the veracity/authenticity of the story depends on the blogger and their motives. 

Note: The vision of this web portal is to help promote news and stories around the Drupal community and promote and celebrate the people and organizations in the community. We strive to create and distribute our content based on these content policy. If you see any omission/variation on this please reach out to us at #thedroptimes channel on Drupal Slack and we will try to address the issue as best we can.

Upcoming Events