Overview

The following article was helpful for integrating Strapi with Elasticsearch.

The source code is also publicly available.

Here, I will note some customizations made based on the above article, including integration with Amazon OpenSearch.

The customized source code is available here:

Modifications

The article references indexing_type, but it needed to be changed to indexing_request_type.

Additionally, to use Amazon OpenSearch instead of Elasticsearch, the following libraries need to be installed.

npm install @opensearch-project/opensearch
npm install @aws-sdk/credential-providers

There are several authentication methods available, but here I made the following changes.

The index registration and deletion processes also needed to be modified as follows.

As a result of these modifications, I was able to connect Strapi with Amazon OpenSearch.

By modifying elastic/elasticClient.js and src/api/search/controllers/search.js, I was also able to customize the API output. This enabled the use of Elasticsearch Aggregations. (Due to my limited investigation, this may also be achievable with Strapi alone.)

Summary

I hope this serves as a helpful reference for integrating Strapi with Amazon OpenSearch.