Goal
Index file attachments such as PDFs and Word documents in Acquia Search using the Search API Attachments module.
Index file attachments such as PDFs and Word documents in Acquia Search using the Search API Attachments module.
This tutorial applies only to Acquia Search powered by Solr. If you use Acquia Search Powered by SearchStax, the process is different.
Prerequisites
Drupal 10 or later
Acquia Connector module installed and active
Step 1: Install and enable the Search API Attachments module
Confirm the Acquia Search and Acquia Connector modules are installed and working as expected.
Add the Search API Attachments module to your codebase.
Sign in with administrator credentials.
Navigate to Manage > Extend.
Select the Search API Attachments checkbox.
Click Install.
Step 2: Configure Search API Attachments to use Acquia Search
Navigate to Manage > Configuration > Search and metadata > Search API attachments.
Select Solr Extractor from the Extraction method dropdown.
From the Solr server dropdown, select the server with an Acquia Search configuration. The name is Acquia Search API Solr server, or similar.
Click Submit and test extraction.
Verify that the system displays a success message such as "Congratulations! The extraction seems working! Yay!"
Step 3: Reconfigure the search index
Navigate to Manage > Configuration > Search and metadata > Search API.
In the Index row, click Edit.
Select the Processors tab.
Select the File attachments processor checkbox to enable it.
Configure the attachment processor to exclude specific file types or apply size limits as needed.
Click Save.
Select the Fields tab, then click Add fields.
Select the relevant attachment fields to index. Configure indexing options such as boosting factors.
Step 4: Update the search view
Navigate to Manage > Structure > Views.
Find and edit the Search view.
In the Filter Criteria section, add the newly indexed attachment fields to the search.
Use Ctrl (Command on macOS) to multi-select: add to the existing fields rather than replacing them.
Save the view.
For a Fulltext filter, add attachment fields to enable fuzzy search across multiple Solr fields. Alternatively, add a separate search field to search solely within attachment contents.
6. Clear the site caches and reindex to ensure that the updates appear in search results.
Click Save changes.
Reindex the search index for the changes to take effect.
Navigate to the SearchStax index.
Click Queue all items for Reindexing.
Click Index now.