PHPackages                             glue-agency/craft-elastic-app-search - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. glue-agency/craft-elastic-app-search

ActiveCraft-plugin[Search &amp; Filtering](/categories/search)

glue-agency/craft-elastic-app-search
====================================

Index Craft Entries to Elastic App Search

5.0.1(4mo ago)0144mitPHPPHP ^8.2

Since Aug 31Pushed 4mo ago4 watchersCompare

[ Source](https://github.com/glue-agency/craft-elastic-app-search)[ Packagist](https://packagist.org/packages/glue-agency/craft-elastic-app-search)[ RSS](/packages/glue-agency-craft-elastic-app-search/feed)WikiDiscussions v4 Synced today

READMEChangelogDependencies (4)Versions (6)Used By (0)

Elastic App Search
==================

[](#elastic-app-search)

Index Craft Entries to Elastic App Search

Requirements
------------

[](#requirements)

This plugin requires Craft CMS 4.0.0 or later, and PHP 8.0.2 or later.

Installation
------------

[](#installation)

You can install this plugin from the Plugin Store or with Composer.

#### From the Plugin Store

[](#from-the-plugin-store)

Go to the Plugin Store in your project’s Control Panel and search for “Elastic App Search”. Then press “Install”.

#### With Composer

[](#with-composer)

Open your terminal and run the following commands:

```
# go to the project directory
cd /path/to/my-project.test

# tell Composer to load the plugin
composer require glue-agency/craft-elastic-app-search

# tell Craft to install the plugin
./craft plugin/install elastic-app-search
```

Usage
-----

[](#usage)

### Backend

[](#backend)

WIP

### Frontend

[](#frontend)

Install the elasticsearch `@elastic/app-search-javascript` package.

The ElasticAppSearch Plugin config `elastic-app-search.php` has a setting `exposeJsVars`. When this is set to `true`, you are able to access the `searchKey` `endpointBase` and `engineName` that are needed to setup the Elastic Client.

Setup the Client

```
ElasticAppSearch.createClient({
    searchKey: window.elasticAppSearch.searchKey,
    endpointBase: window.elasticAppSearch.endpointBase,
    engineName: window.elasticAppSearch.engineName
});
```

Configuration
-------------

[](#configuration)

If you create a `elastic-app-search.php` file in the `config` folder you can overwrite the following plugin settings. The config file supports [multi env setup](https://craftcms.com/docs/4.x/config/#multi-environment-configs).

```
