Goal
To help Drupal developers enhance Acquia Search by indexing attachments like PDFs using the Search API Attachments module
Overview
This article was co-authored by Kass Pepper and JP McNeal.
People love PDFs. They are used to share everything from recipes or restaurant menus to financial reports. From a website search perspective, these beloved docs might as well be scrawled in invisible ink -- their content remains buried without the right indexing.
For Drupal developers using Acquia Search with Search API, contrib modules offer a powerful solution. The Search API Attachments module leverages the capabilities of Apache Solr to extend and add value to the search feature on your site, allowing users to find relevant content within various file types (yes, including PDFs). Here's a detailed guide on how to get this set up for a Drupal 10 site hosted on Acquia.
Note: This tutorial assumes you have installed and configured Acquia Search.
-
Step 1: Install and enable the Search API Attachments module
Begin by enhancing your Drupal installation with the ability to process and index file attachments:
- Confirm the Acquia Search and Acquia Connector modules are installed and working as expected.
- Add the Search API attachments module to your code base.
- Sign in with administrator credentials.
- Navigate via the admin toolbar to Manage > Extend.
- Enable the Search API Attachments module by selecting its checkbox, then click "Install" at the bottom of the page.
-
Step 2: Configure Search API Attachments to Use Acquia Search
Configure the module to tap into the power of Acquia Search:
- Go to Manage > Configuration > Search and metadata > Search API attachments.
- Select Solr Extractor from the Extraction method dropdown.
- From the Solr server dropdown, choose the server with an Acquia Search configuration (it will be named Acquia Search API Solr server, or similar).
- Test the configuration by clicking Submit and test extraction.
- If successful you will see a confirmation message, such as "Congratulations! The extraction seems working! Yay!"
-
Step 3: Reconfigure the Search Index
Configuring Search API Attachments in this way empowers a better search experience on your Drupal site, granting users the convenience of locating content concealed within file attachments, transforming the way content is discovered on your platform. With proper indexing, the invisible ink of PDFs and other documents becomes visible and searchable to your users.
Thumbnail Photo by Agence Olloweb on Unsplash