Overview

While developing a system using Drupal, I needed to implement search functionality that considers variant characters (itaiji), so I created a custom module to achieve this. (There may already be an existing module that does the same thing, but I was unable to find one.)

It is published in the following repository:

https://github.com/nakamura196/Drupal-module-itaiji

Usage

Configuration

Access /admin/config and click the Itaiji link under the Search and metadata section.

In the Conversion Rules form, enter conversion rules in the format original1, original2 => converted.

Search API

Access the Processors for an index created using the search_api module:

/admin/config/search/search-api/index/{INDEX_NAME}/processors

Enable the Itaiji item.

With this, conversion based on the conversion rules is performed as a preprocessing step for both indexing and queries, enabling search that considers variant characters.

Notes and Summary

Testing has only been performed with a database selected as the Search API Backend. Also, as I have limited development experience with Drupal, there may be many other bugs. Please use with caution.

I hope this serves as a useful reference for developing search systems using Drupal’s Search API.