PHPackages                             ph2m/magento2-elasticsearch - 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. ph2m/magento2-elasticsearch

ActiveMagento2-module[Search &amp; Filtering](/categories/search)

ph2m/magento2-elasticsearch
===========================

Search with Elasticsearch for Magento 2

1.1.4(1y ago)73.8k↓42%1[1 issues](https://github.com/PH2M/magento2-elasticsearch/issues)MITPHPPHP ~8.0

Since Jun 11Pushed 1y ago4 watchersCompare

[ Source](https://github.com/PH2M/magento2-elasticsearch)[ Packagist](https://packagist.org/packages/ph2m/magento2-elasticsearch)[ RSS](/packages/ph2m-magento2-elasticsearch/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)DependenciesVersions (9)Used By (0)

Simple Magento 2 search with ElasticSearch
==========================================

[](#simple-magento-2-search-with-elasticsearch)

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

[](#installation)

First, install the Magento module:

```
composer require ph2m/magento2-elasticsearch

```

You need to install the analysis-icu plugin for ElasticSearch.

You have to lock the Elasticsearch configurations:

```
php bin/magento config:set --lock catalog/search/elasticsearch7_server_hostname
php bin/magento config:set --lock catalog/search/elasticsearch7_server_port
php bin/magento config:set --lock catalog/search/elasticsearch7_index_prefix
php bin/magento config:set --lock catalog/search/elasticsearch7_enable_auth
php bin/magento config:set --lock catalog/search/elasticsearch7_username
php bin/magento config:set --lock catalog/search/elasticsearch7_password

```

Copy file `es.php.sample` to your Magento `pub` directory and customize it if needed.

```
cp vendor/ph2m/magento2-elasticsearch/etc/es.php.sample pub/es.php

```

Update your `Magento_Theme/templates/html/header.phtml` file to include the search form.

```
