This project is not covered by Drupal’s security advisory policy.
Old version: https://drupal.org/project/elastic_appsearch
This module is similar to Search API Solr, What Search API Solr is for Solr, this is for Elastic Enterprise Search.
Submodules
This module currently have only one submodule called appsearch, that allow drupal to connect with elastic apps search. In future we may add one more submodule to connect with elastic workplace search.
- Elastic App Search (Added)
- Elastic Workplace Search (To be added in future)
This module allows Drupal to connect with elastic enterprise search. Elastic Enterprise search is an elastic product that is built on top of elastic search. Elastic enterprise search provides the capability to add search functionality to any website. This also provides search analytics along with the search. The features of Elastic Enterprise Search are:
- Top search keywords
- Top search keywords with no results
- Top search results with clicks
- Top search results with no clicks
- UI to add synonyms
- Ability to Currat search result
- Pin certain results on top for a specific keyword
- Ability to adjust the weight on indexed fields
- Ability to create multiple search engine
- Fine tune the search results
- Ability to choose search filters, sorting options and search result title and link
Dependency
- Search API
- Elastic Enterprise Search PHP SDK
- Pathauto
- Guzzle 6 HTTP Adapter (if you are using D9)
- Guzzle 7 HTTP Adapter (if you are using D10)
This module uses https://github.com/elastic/enterprise-search-php PHP SDK to do all the operations with Elastic Enterprise search.
Running Elastic enterprise search with docker
- Follow official guide to run Elastic Enterprise Search 7.17 in local.
- Follow official guide to run Elastic Enterprise Search 8.7 in local.
- If you are using
ddevand want to runElastic Enterprise Search 8.7as a part of yourddevstack. You can use the following steps:- Copy the provided
.envanddocker-compose.enterprise-search.yamlfile indocker-compse/ddevfolder to.ddevfolder of your project. - Run the
ddev startorddev restartcommand. - Use the
http://enterprisesearch:3002as the elastic enterprise search server url.
- Copy the provided
Installation
- Use composer for getting all the module dependencies
- Enable module
- Go to Configuration -> Search and metadata -> Elastic AppSearch
- Add Engine by giving the Appsearch server credentials and enable the server
- Add Engine by giving the engine details and content types you need to index.
- Add Schema by selecting the fields you want to index and select the field type.
- Click on the newly created engine and Click on the index now to index all the documents
- Go to Configuration -> Search and metadata -> Search UI and create a new search UI entity.
- Now you will have a search block available in block configuration which can be enabled on any page.
Features
- Ability to create Multiple Server
- Ability to create multiple Engines within that server
- Ability to choose the fields for indexing for each engine
- Ability to choose the field types for schema
- Ability to create multiple UI for each search engine
- Each Search UI is available as a Drupal block that can be enabled on any page
- Ability to choose content types for indexing for each engine
- Batch indexing of documents
Limitation
Elastic Enterprise Search provides the ability to index a maximum of 64 fields in each document. There is no option to delete the previously indexed field. You have to delete the complete engine and recreate the new one with the new schema. See Official limits page.
Overriding Search-UI component
The search-ui is a react application that is available as a Drupal block. Sometimes you may want to override the search-ui react component. For example, you may want to add a new field in the result component based on content type or change the look and feel of the search-ui. By default search ui result component display the search result in key-value pair.
But search-ui allows you to override the result component by providing a resultView props to Result component <Results resultView={CustomResultView} />. We have created a custom result component that you can find in modules/appsearch/search-ui/src/components/ResultView/index.js. You can override this component by creating a new component in your custom module by following the below steps:
- Create a custom module called something like
my_custom_searchuiunderdocroot/modules/customfolder. - Create the component file
docroot/modules/custom/my_custom_searchui/ResultView/index.jsand copy the content frommodules/appsearch/search-ui/src/components/ResultView/index.jsfile. - Make the changes you want to make in the component.
-
Add the following line in your
composer.jsonfile."scripts": { "post-install-cmd": [ "cp -rf docroot/modules/custom/my_custom_searchui/* docroot/modules/custom/elastic_enterprise_search/modules/appsearch/search-ui/src/searchui_components_override", "cd docroot/modules/custom/elastic_enterprise_search/modules/appsearch/search-ui && npm install && npm run build" ] } -
Run the composer install command
composer installthis will copy your component to the search-ui folder and build the search-ui.
Note: This is a current limitation because the search-ui is a react application and we have to build the application to see the changes and react application can not include the component from outside the application. See getComponent function in modules/appsearch/search-ui/src/utils/index.tsx file.
Resources
Roadmap
- Add test connection feature on the server page.
- Remove dependency on path auto and search api module.
- Add support for other entities apart from nodes.
Add support for the elastic Date field that is being indexed as the number as of now.- Done- Add support for both ASEC and DESC sort filters.
- Add support for all content entities, currently it only supports node entity to index.
Project information
- Project categories: Site search
- Ecosystem: Search API Elasticsearch
- Created by msankhala on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.



