Information for: DEVELOPERS   PARTNERS

Partial word matching

Acquia Search supports Solr N-Gram (partial-word search) text fields for Drupal 8 and greater websites using the Search API module. For example, searching a correctly configured search index for ful will match full and fulltext (if the indexed data uses the correct field type).

Configuring partial-word searching

To enable partial-word searching in Acquia Search, perform the following steps:

  1. Configure your subscription to support partial-word searching.
  2. Configure your search index fields in your Drupal website.
  3. Configure your filter for any views in your Drupal website providing search features.

Configuring your subscription for partial-word searching

To configure your Acquia Search subscription to use a search schema that supports partial-word searches, complete the following steps:

  1. Sign in to Cloud Platform as a user with the Owner or Administrator role.
  2. Select your application, and in the left menu, click Acquia Search.
  3. In the top right of the page, click the Edit icon.
  4. In the Acquia Search configuration set list, click Search API Solr 8.x-1.x and 7.x-1.x, Apache Solr 7.x-1.6+.
  5. Click Save.

After you configure your subscription for partial-word searching, you must next configure your website’s search index fields to support partial-word searches.

Configuring your search index fields for partial-word searching

After you enable your subscription to support partial-word searching, complete the following steps to configure your Drupal website to support partial-word searching:

Note

If you are configuring Acquia Search for the first time, install, and activate the modules for Acquia Search as described in Using the Search API module. For more information about the module versions compatible with Acquia Search, see Modules for Acquia Search.

  1. Sign in to your Drupal website as an administrative user.
  2. In the admin menu, go to Configuration > Search and metadata > Search API.
  3. Identify the search index you want to change, and then select it.
  4. Click the Fields tab.
  5. For each field you want to configure for partial-word searching, click Type, and then click Fulltext NGram.
  6. Click Save.

After configuring your search index fields, configure the filters in your views to properly forward partial-word search queries to your Solr back end.

Configuring your views for partial-word searching

To configure the filters in your views to accept partial-word search queries to your Solr back end, perform the following steps:

  1. Sign in to your Drupal website as an administrative user.
  2. In the admin menu, go to Structure > Views.
  3. Find the view you want to configure, and then click its Edit link.
  4. Edit the Search: fulltext search filter.
  5. For each filter for which you want to use partial-word searching, click the Parse mode check box, and then click Direct query.
  6. Click Save.

After you save your changes, the filter will send search queries unaltered to your Solr back end.

Important

After changing the search configuration, you must fully reindex all your data for the changes to take effect.