Skip to main content
Image
Architectural%20Capsule-01%20%281%29.png

Architecture Capsules by Vid: A loveable and fast search experience for your Drupal site

Drupal

Do you need business search applications and enterprise features for your digital business? Elasticsearch, in combination with Drupal 8, can be a perfect fit. This edition of Architecture Capsules brings you the valuable tips and tricks on implementing Elasticsearch with Drupal.

Illustration showing a desktop, magnifying lens, human brain, bulb, globe and cloud


Business use case and benefits

Implement a user friendly and modern search experience in low turn around time and in budget.

Requirement criteria

1. Search should allow users an easy way to drill down content. (Read facets)
2. Search experience should be super fast. (Read Decoupled / elastic)
3. Should work seamlessly with Drupal content.

Stack used

Drupal 8, ElasticSearch, React, Elasticsearch connector module, Searchkit (It is a suite of React components that communicate directly with your Elasticsearch cluster).

Architecture notes

Flowchart with a droplet on left and Alphabet E on right to represent Elasticsearch and Drupal association


1. Configure the elasticsearch connector module on your Drupal 8 site to connect and index your content in elastic search. This link might be useful for further read on this.
2. Use npm to install searchkit.
3. Configure searchkit to make connection to elastic server. For more information, read here.
4. Make sure to check if you need to proxy the connection to elastic or not. In case you do, SearchKit has a plugin (Searchkit-express) which does that easily.
5. Generate the build of searchkit. Integrate the build with empty target container div in a drupal block or your theme.
5. More customisations and custom extentions for searchkit can be written. Follow the decently wide documentation it has.

Things to watch out for (Read Caution!)

The components in Searchkit require elasticsearch fields indexed in a particular way. For example, the Hierarchical Menu needs data to be indexed in levels. See Indexing & Mapping Guide or the component's pages for more information. You might need to add custom fields indexed in particular way from a custom Drupal module.

Subscribe

Ready to start your digital transformation journey with us?

Loading form...

Related Blogs

DrupalCamp Delhi Returns After 6 Years: Here’s What to Expect

 

DrupalCamp Delhi Returns After 6 Years Here is What to Expect OpenSense Labs

“After the COVID period, this marks the first time the camp is returning to Delhi. Over the years, the camp and the local…

Drupal's Role as an MCP Server: A Practical Guide for Developers

Drupals Role as an MCP Server A Complete Practical Guide for Developers OpenSense Labs

"The MCP provides a universal open standard that allows AI models to access real-world data sources securely without custom…

What’s New in Drupal CMS 2.0: A Complete Overview

What is New in Drupal CMS 2 0 OpenSense Labs

"Drupal CMS 2.0 marks a significant change in the construction of Drupal websites, integrating visual site building, AI…