Search API Attachments in Body field configuration page
Body field test data setup
Test search results


Search API Attachments in Body Field allows Search API to index the contents of files referenced in body fields.

In order for these files to be detected and indexed, the file needs to be:

  • managed by Drupal (i.e.: in the `file_managed` table, e.g.: uploaded with the Media module), and,
  • referenced with a full, absolute URL to the file (it can be in an HTML attribute), and,
  • the hostname in the URL needs to match the hostname that Drupal detects that it is being accessed from.

That is to say, if your site is at, then the following HTML snippets will cause the file to be indexed...
<a href="">My file</a>

... but the following HTML snippets will (currently) not cause the file to be indexed...

<a href="/sites/default/test.txt">My file</a>
<a href="public://test.txt">My file</a>



I plan to keep this module working with the latest version of Search API and Search API attachments. Other than that, I don't really have any new features planned.

Known problems

I don't know of any problems at this time, so if you find one, please let me know by adding an issue!

Help wanted!

If you want to become a co-maintainer, please read the Drupal community's best practices for co-maintaining projects, then file an issue requesting to become a co-maintainer.

  • Search API attachments indexes files attached to entities. This module identifies files referenced in body fields, and uses the Search API attachments module's API to index them.
Supporting organizations: 

Project information