PHPackages                             holoo/module-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. holoo/module-elasticsearch

ActiveLibrary[Search &amp; Filtering](/categories/search)

holoo/module-elasticsearch
==========================

create module elastic for laravel

v1.0.6(3y ago)091MITPHPPHP ^8.0.2

Since Sep 6Pushed 3y ago1 watchersCompare

[ Source](https://github.com/aminsaki/ModuelEalsticSerach)[ Packagist](https://packagist.org/packages/holoo/module-elasticsearch)[ RSS](/packages/holoo-module-elasticsearch/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (11)Versions (7)Used By (0)

moduel Laravel-Elasticsearch for laravel 9
==========================================

[](#moduel-laravel-elasticsearch--for-laravel--9)

Build Status Total Downloads Latest Stable Version Latest Stable Version License

Getting started
===============

[](#getting-started)

Using this client assumes that you have an Elasticsearch server installed and running.

You can install the client in your PHP project using composer:

Once you’ve run a composer update command, you must register the Laravel service provider in your config/app.php file.

install
=======

[](#install)

Using this client assumes that you have an Elasticsearch server installed and running.

You can install the client in your PHP project using composer:

```
 ...
 // composer require holoo/module-elasticsearch
 ...

```

config/app.php
==============

[](#configappphp)

'providers' =&gt; \[ ... // \\Holoo\\ModuleElasticsearch\\ServiceProvider\\ModuleElasticSearchServiceProvider::class,

```
 //php artisan vendor:publish --tag=elastic_serach
 ...

```

\]

config/elastic
==============

[](#configelastic)

return \[

```
   "host"=>env('ELASTICSEARCH_HOST', "http://localhost:9200"),
   "apiKey"=>env('APIKEY', ''),

```

\];

Environment Configuration .env
==============================

[](#environment-configuration--env)

Add the following code in the .env section
...

```
ELASTICSEARCH_HOST =https://localhost:9200
APIKEY=""

```

...

exmple code
===========

[](#exmple-code)

---

index
=====

[](#index)

//This insert is in elasticserach That you It has two sides The first table of names The second bank is an ID The third company is a provider that you can see For example : ...

```
 public function index()
   {
       $result=ElasticClient::create();

       $re=$result->index('index', 'my_id48848',['title'=>'test','body'=>'this is one test']);

       return $result->resultHit($re);

   }
 ...

```

serach
======

[](#serach)

This is for elastic search which includes three parameters First parameter: The name of the table is the name you entered in the # index field

The second part is the name of the field you are going to search for

The third part is the value to be searched for

For example

```
...

 public function serach()
   {
       $result=ElasticClient::create();
       $re=$result->search('index', 'title', 'test');
       $r=$result->resultHit($re);
       return $r;
   }
 ...

```

delete
======

[](#delete)

To delete information in Elastic Search, two must be entered The first list is the name of the table written in the list field Second, you entered the ID in the list field For example

```
...

 public function delete()
   {
       $result=ElasticClient::create();
       $re=$result->delete('index', 'my_id48848' );
       $r=$result->resultHit($re);
       return $r;
    }
 ...

```

bulk
====

[](#bulk)

This method is for doing several operations together For example, delete, add and update It contains three parameters

The first parameter is the name of the table The second parameter is used to create or update

The third parameter is the type of operation to be performed

The tip is normally set to create

For example

```
 public function bulk()
    {
        $result=ElasticClient::create();
        $re=$result->bulk('index', ['title'=>'test','body'=>'this is one test'] ,'index');
        $r=$result->resultHit($re);
        return $r;
     }
  ..

```

reindex
=======

[](#reindex)

This method has a task Take a chat from your table

It contains two parameters

The first parameter is the name of the table you created earlier in the insert field The second parameter is the name of the chat table, which you can choose any name you want

For example

```
 public function reindex()
     {
         $result=ElasticClient::create();
           $re=$result->reindex('index', 'index2');
         $r=$result->resultHit($re);
         return $r;
      }
   ..

```

mtermvectors
============

[](#mtermvectors)

Retrieves multiple term vectors with a single request.

This method creates a vector of your text This method includes

is the first name of the table The second bank is an identifier in the table of your choice

The third is an identifier in the table of your choice

The fourth is the name of the field for which you want to create a vector The text is long

Set five to true if the vector contains more letters, otherwise set to false

For example

```
 public function reindex()
     {
         $result=ElasticClient::create();
          $re=$result->mtermvectors('index', '1','2','messages',"");
         $r=$result->resultHit($re);
         return $r;
      }
   ..

```

Dsl query elastic Serach
========================

[](#dsl--query--elastic-serach)

Using this method, you can enter sql database This method is for someone who is not familiar with elastic serach For example

```
 public function lists ()
     {
         $result=ElasticClient::create();
          $re=$result->query("select * from index);  ///  name table  name index
         $r=$result->resultHit($re);
         return $r;
      }
   ..

```

lists
=====

[](#lists)

This method is used to display the tables that exist in elasticserach

A parameter takes the name of the table

Note: If you want to display all the tables, you must use the word -all

For example

```
 public function lists ()
     {
         $result=ElasticClient::create();
          $re=$result->lists('index');  ///  name table or _all
         $r=$result->resultHit($re);
         return $r;
      }
   ..

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

6

Last Release

1315d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bb5d6108551f0a291e974341a63b0c9960899033b8fe2a040c282b6768af5bc7?d=identicon)[aminsaki](/maintainers/aminsaki)

---

Top Contributors

[![aminsaki](https://avatars.githubusercontent.com/u/24852255?v=4)](https://github.com/aminsaki "aminsaki (1 commits)")

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/holoo-module-elasticsearch/health.svg)

```
[![Health](https://phpackages.com/badges/holoo-module-elasticsearch/health.svg)](https://phpackages.com/packages/holoo-module-elasticsearch)
```

###  Alternatives

[opensearch-project/opensearch-php

PHP Client for OpenSearch

15024.3M65](/packages/opensearch-project-opensearch-php)[jeroen-g/explorer

Next-gen Elasticsearch driver for Laravel Scout.

397612.3k](/packages/jeroen-g-explorer)[algolia/algoliasearch-magento-2

Algolia Search &amp; Discovery extension for Magento 2

1881.8M16](/packages/algolia-algoliasearch-magento-2)[loupe/loupe

A full text search engine with tokenization, stemming, typo tolerance, filters and geo support based on only PHP and SQLite

497185.2k14](/packages/loupe-loupe)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[statamic-rad-pack/meilisearch

meilisearch search driver for Statamic

1661.7k](/packages/statamic-rad-pack-meilisearch)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
