Is there a way to index PDF files so that they can be searched (the text inside the PDF) without using java? Our host refuses any software that requires java, and every module I've found has required it. Since the host refuses anything that uses java, I haven't been able to find a solution that works.

  • Are you using Search API attachments for the integration? If so then no, there's no built-in support for a PHP extractor (if such a thing even exists out in the wild). It does support alternatives to Java, though (pdftotext, python, golang, etc). If your backend is Solr, there's also a built-in extractor which can be used, if it's enabled
    – Clive
    Commented Dec 19, 2023 at 21:36
  • We haven't chosen the back-end for it since we were still choosing which modules to use. Every time I think I have one, I find that something that is required uses java and I'm right back to the beginning. So, I'm fairly open with regards to what to use. Commented Dec 19, 2023 at 22:32

1 Answer 1


In theory, you should be able to use a combination of the following modules to index PDF content, without any external dependencies:

The third module needs a patch to make it compatible with Drupal 10. If you don't already have it in your composer.json, you'll need to install and allow the Drupal Lenient composer plugin to require the module without errors.

There are some simple instructions on setting up the attachments module here, you would choose the "PHP" extractor instead of "Solr".

It's worth bearing in mind that more advanced search solutions aren't usually based on PHP/SQL, for performance reasons. If you're indexing a lot of documents, you might see some degradation. If that happens you'll probably need to consider implementing/purchasing a more purpose-built solution (like a Solr instance).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.