Elasticsearch is a powerful, distributed, RESTful search and analytics engine based on Apache Lucene that supports full-text search, vector search, retrieval augmented generation (RAG), facets, spellchecking, hit highlighting, auto-completion, location-based searching, and more.
This modules provides a Search API backend for Elasticsearch, using the official Elasticsearch PHP Client.
Note that, in January 2021, Amazon forked Elasticsearch (then at version 7.10.2) to create OpenSearch, and the two projects have diverged over time. If you are using OpenSearch, please consider using the Search API OpenSearch module instead.
Requirements
Elasticsearch Connector requires the Search API module to function.
Recommended modules
The following modules are optional, but can extend the functionality of Elasticsearch Connector:
- The Facets module, which allows site builders to easily create and manage faceted search interfaces.
- The Geofield module, which allows storing, managing and representing dynamic geographic data in Drupal.
- The Search API Autocomplete module, which provides autocomplete functionality for searches.
- The Search API Location module, which allows location-based searching.
- The Search API Spellcheck module, which suggests corrections to misspelled words in the search query ("Did you mean ...?").
Roadmap
The ElasticSearch Connector maintainers intend to support ElasticSearch only, i.e.: we do not intend to support OpenSearch, because the Search API OpenSearch module does that already.
The maintainers intend to support versions of this module that are compatible with the currently-supported versions of Elasticsearch. For more information, please see Elasticsearch's documentation on Elastic Product End of Life Dates.
Elasticsearch release series | Drupal module release series | Drupal module supported? | Maintenance status |
---|---|---|---|
8.x | 8.0.* | Yes | Actively maintained |
7.x | 8.x-7.* | Yes | Security and bug fixes only |
6.x | 8.x-6.* | No | |
5.x | 8.x-5.*, 7.x-5.* | 7.x-5.* only | Security and bug fixes only |
2.x, 1.x | 8.x-2.*, 7.x-2.* | No | |
1.x | 7.x-1.* | No |
Known problems
If you find a problem, please let us know by adding an issue!
In the 8.0.* release series, changing the mapping of an existing field or deleting a field will cause the search index to be cleared, and all items queued for re-indexing. This is a limitation of Elasticsearch: see the Elasticsearch documentation on their Update mapping API for more details. We plan to mitigate this by using Elasticsearch's Aliases API to automatically creating a new index and reindexing to it in #3248665: Support Aliases API and zero downtime mapping updates.
Credits
NodeSpark, Google Summer of Code (GSoC) 2014, FFW, and Utilis.io sponsored initial development of Elasticsearch Connector.
Fame Helsinki, Ontario Digital Service, and Consensus Enterprises sponsored maintenance and support for Elasticsearch 8.
This module was created by Nikolay Ignatov (skek) who maintains the list of maintainers. If you would like to become a maintainer yourself, please reach out to him directly.
Similar projects and how they are different
- Search API OpenSearch provides a Search API backend for OpenSearch. OpenSearch was created as a fork from Elasticsearch version 7.10.2, but the two projects have diverged, and there are breaking changes in the API for indexing and querying.
- Azure search provides a Search API backend for Microsoft Azure AI Search. Microsoft Azure AI Search has a different set of features, and a different API for indexing and querying than Elasticsearch.
- Search API Solr provides a Search API backend for Apache Solr, another Lucene-based search engine. Solr has a different set of features, and a different API for indexing and querying than Elasticsearch.
- Elasticsearch - Search API and Search API Elasticsearch: both provide frameworks to set up custom Elasticsearch based search pages, but are only compatible with Drupal 7.
- Elasticsearch Helper (and the Elasticsearch Helper ecosystem): deliberately avoid building on top of Search API (and the Search API ecosystem), in order to provide tighter integration with ElasticSearch.
Note that there is at few modules that extends Elasticsearch Connector:
- Elasticsearch Connector Suggester improves suggested auto-completion results by letting you set tokenizer parameters on full-text fields.
- Search API Elasticsearch Synonym provides synonym functionality for Elasticsearch.
Dependencies
In order to function, this module requires a connection to an Elasticsearch cluster:
- Elasticsearch B.V., the company that created Elasticsearch and sponsors its development, offers Elasticsearch as a Service through a product called Elastic Cloud (which can be hosted on Amazon Web Services (AWS), Google Cloud Platform (GCP), and/or Microsoft Azure, and has a 14-day free trial).
- Some hosting providers (e.g.: Platform.sh, Lagoon) offer Elasticsearch plugins.
- You can also self-host Elasticsearch with Docker or Kubernetes.
- To test with a single-node cluster in CI, see this project's
.gitlab-ci.yml
on the8.0.x
branch. - For local development, both ddev and lando provide officially-supported plugins; or you can run it locally.