Skip to content
Snippets Groups Projects
Mohammad Al-Fayoumi's avatar
Issue #3477916 by rahaf albawab, mohammad-fayoumi: Update the configuration in loadSearchApiServer
Mohammad Fayoumi authored
e41c3cb6
History

INTRODUCTION

The Search API ElasticSearchKit Proxy module is a Drupal module that acts as a proxy to handle Elasticsearch search requests. It integrates with the elasticsearch_connector and search_api modules to dynamically configure and manage Elasticsearch clusters and servers. The module supports decoupled architectures by enabling a React app to communicate with the Drupal backend for search functionality.

The primary use cases for this module are:

  • Proxy Elasticsearch Requests: Centralize Elasticsearch queries through a Drupal controller for better control and security.
  • Decoupled Search App Integration: Provide a secure API endpoint for React or other decoupled front-end applications.
  • Supports Authentication: Manage both anonymous and Basic Authentication for Elasticsearch clusters.

FEATURES

  • Extendable Controller: The module allows you to extend the controller in your custom module. This enables you to modify Elasticsearch queries and the returned JSON results to suit your specific requirements.
  • Proxy Elasticsearch Requests: Securely act as a proxy for Elasticsearch queries, allowing front-end applications to perform searches without exposing sensitive data.
  • Framework Agnostic: Works seamlessly with any frontend (e.g., React, Vue) in decoupled setups.
  • Advanced Security: Adds filtering and security features to the Elasticsearch requests.

REQUIREMENTS

This module depends on the following modules and services:

INSTALLATION

Install the module as you would normally install a contributed Drupal module. See: Drupal Module Installation Guide for further information.

This depends on Elasticsearch - Search API which in turn depends on elasticsearch_connector and search_api

  1. Install required module using Composer:
    composer require drupal/search_api_elasticsearchkit_proxy
  2. Enable the module via the Drupal admin UI or Drush:
    drush en search_api_elasticsearchkit_proxy

CONFIGURATION

  • Step 1: Configure your Elasticsearch connection in the elasticsearch_connector settings at /admin/config/search/elasticsearch-connector.
  • Step 2: Set up a search index using Elasticsearch as the backend via the search_api module at /admin/config/search/search-api.
  • Step 3: Configure the proxy settings in the Search API ElasticSearchKit Proxy module at /admin/config/search/elasticsearch-proxy-server.
  • Step 4: Ensure your React app points to the Drupal proxy endpoint for search queries.
  REACT_APP_ELASTICSEARCH_HOST=https://example.com/api/search

MAINTAINERS

Current maintainers for Drupal 10: