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

Abandoned → [coldtrick/opensearch](/?search=coldtrick%2Fopensearch)ArchivedElgg-plugin[Search &amp; Filtering](/categories/search)

coldtrick/elasticsearch
=======================

An Elasticsearch implementation for Elgg

v7.0.1(4y ago)31.8k2GPL-2.0-onlyPHP

Since Mar 8Pushed 4y ago1 watchersCompare

[ Source](https://github.com/ColdTrick/elasticsearch)[ Packagist](https://packagist.org/packages/coldtrick/elasticsearch)[ Docs](https://www.coldtrick.com)[ Fund](https://www.paypal.me/ColdTrick)[ GitHub Sponsors](https://github.com/ColdTrick)[ RSS](/packages/coldtrick-elasticsearch/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (3)Versions (36)Used By (0)

Elasticsearch
=============

[](#elasticsearch)

[![Elgg 4.1](https://camo.githubusercontent.com/a39d2fc8ed18243861c9dcd2ad9e9d6a2b1f02a0eadd10315af68e732f2206f0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f456c67672d342e312d677265656e2e737667)](https://camo.githubusercontent.com/a39d2fc8ed18243861c9dcd2ad9e9d6a2b1f02a0eadd10315af68e732f2206f0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f456c67672d342e312d677265656e2e737667)[![ElasticSearch 7.4](https://camo.githubusercontent.com/6fdba66425ebf08ddbb5575dbd44cd9c748ded7322966a8134c7a157ef3267f0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f456c61737469635365617263682d372e342d677265656e2e737667)](https://camo.githubusercontent.com/6fdba66425ebf08ddbb5575dbd44cd9c748ded7322966a8134c7a157ef3267f0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f456c61737469635365617263682d372e342d677265656e2e737667)[![Build Status](https://camo.githubusercontent.com/c8fdfcd3c2d925f76d804c1a6fa12118b89fff34bc51826005fa4424b5e2f0ef/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f436f6c64547269636b2f656c61737469637365617263682f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ColdTrick/elasticsearch/build-status/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/f1eea75911c97037045ac7c363c6cff8bd08e008eb5fc50d773b6958b0a24d4d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f436f6c64547269636b2f656c61737469637365617263682f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ColdTrick/elasticsearch/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/61b48abd6fbd447a0a4dd73ec504bd16a0a64f40096ba9af77aa18db279b2ea2/68747470733a2f2f706f7365722e707567782e6f72672f636f6c64747269636b2f656c61737469637365617263682f762f737461626c652e737667)](https://packagist.org/packages/coldtrick/elasticsearch)[![License](https://camo.githubusercontent.com/290e5d3a1103c21d5816bb02669fa149c8f6436a2e7b6d427210e2a5c1b7778c/68747470733a2f2f706f7365722e707567782e6f72672f636f6c64747269636b2f656c61737469637365617263682f6c6963656e73652e737667)](https://packagist.org/packages/coldtrick/elasticsearch)

An Elasticsearch implementation for Elgg

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

[](#requirements)

A working [ElasticSearch](https://www.elastic.co/) server is required. Also the minute cron has to be working on your Elgg installation. The minute cron is used to update the index with all the required changes (create/update/delete).

The current supported version of ElasticSearch is: 7.4.x

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

[](#configuration)

### Settings

[](#settings)

The plugin settings allow you to configure the following:

- Hosts: 1 or more hosts need to be configured (full URL + optional portnumber). You can provide more hosts comma seperated.
- Index: Name of the index used for indexing Elgg data and search queries
- Search alias (optional): Name of the alias to use in search queries, this allows for easy searching across multiple indices

### Index Management

[](#index-management)

The index management page (found under Administer -&gt; ElasticSearch -&gt; Indices in the admin sidebar) allows you to perform various actions on all the indexes available on the ElastisSearch server. The following actions are supported:

- Create: This action can only be performed if the index configured in the plugin settings page is not yet available. It will create the default index configuration to be used for search.
- Alias: Add/remove the configured alias to the index (this allows searching across multiple indices)
- Delete: This will remove the index from the server (this action can not be undone)

Administration
--------------

[](#administration)

### Log files

[](#log-files)

Based on the log level of your Elgg site, there will also be logging of the ElasticSearch PHP client library. Logging will appear in the same location as all other Elgg logs.

### Statistics

[](#statistics)

You can find various statistics on the Administer -&gt; ElasticSearch -&gt; Statistics page. Elgg statistics report on the amount of entities found in the Elgg database that should be in the index. It also reports on the amount of entities that need to be added/updated/deleted in the index and that are currently waiting on the minute cron to process them.

Also some statistics from the Elastic Cluster are shown like the status and the version information.

You can also find statistics for all available indexes on this page.

### CLI commands

[](#cli-commands)

CLI commands are available to be used with the default `elgg-cli` command

#### elasticsearch:sync

[](#elasticsearchsync)

This command will synchronize all pending entities to the Elasticsearch index. This is especialy usefull during the reindexing process of the database because a lot of entities need to be indexed. Using the normal cron task in this case could take a long time.

Recommendations
---------------

[](#recommendations)

Use the [Search Advanced](http://github.com/ColdTrick/search_advanced) plugin to add extra features to search. If both are enabled this plugin provides a menu to sort/order the results.

Developers
----------

[](#developers)

### Plugin hooks

[](#plugin-hooks)

#### 'boostable\_types', 'elasticsearch'

[](#boostable_types-elasticsearch)

Return an array of type.subtype to be used for configuaring boosting in Elasticsearch.

In the format:

```
[
	'type.subtype',
]
```

Defaults to the registered searchable type/subtypes for Elasticsearch.

#### 'config:index', 'elasticsearch'

[](#configindex-elasticsearch)

Return an array with the index configuration to be used by Elasticsearch.

#### 'config:mapping', 'elasticsearch'

[](#configmapping-elasticsearch)

Return an array with the mapping configuration to be used by Elasticsearch.

#### 'export:counters', 'elasticsearch'

[](#exportcounters-elasticsearch)

Return an array of counters to be exported to Elasticsearch.

In the format:

```
[
	'counter_name' => counter_value
]
```

Params contain:

- `entity`: the `ElggEntity` being exported

#### 'export:metadata\_names', 'elasticsearch'

[](#exportmetadata_names-elasticsearch)

Return an array of metadata names to be exported to Elasticsearch.

Params contain:

- `entity`: the `ElggEntity` being exported

#### 'index\_entity\_type\_subtypes', 'elasticsearch'

[](#index_entity_type_subtypes-elasticsearch)

Return an array of type/subtypes allowed to be indexed by Elasticsearch.

In the format:

```
[
	'type' => ['subtype1', 'subtype2'],
]
```

Defaults to all registered searchable type/subtypes in Elgg.

#### 'index:entity:prevent', 'elasticsearch'

[](#indexentityprevent-elasticsearch)

Return `true` if the provided entity shouldn't be added to the Elasticsearch index

Params contain:

- `entity`: the `ElggEntity` about to be indexed

Default: `false`

#### 'index:entity:type', 'elasticsearch'

[](#indexentitytype-elasticsearch)

Return a string under which type/subtype the entity should be indexed. This is used for type filtering during the search (eg. all blogs)

Params contain:

- `entity`: the `ElggEntity` about to be indexed
- `default`: the default type/subtype for this entity

Default: `{entity_type}.{entity_subtype}` (eg. `object.blog`)

#### 'params', 'elasticsearch'

[](#params-elasticsearch)

Return an array of parameters to be using in initializing the `\ColdTrick\ElasticSearch\Client` Elasticsearch client.

#### 'search', 'type\_subtype\_pairs'

[](#search-type_subtype_pairs)

Return an array of type/subtypes allowed to be searched by Elasticsearch.

In the format:

```
[
	'type' => ['subtype1', 'subtype2'],
]
```

Defaults to all registered searchable type/subtypes in Elgg.

#### 'search\_params', 'elasticsearch'

[](#search_params-elasticsearch)

Return an `\ColdTrick\ElasticSearch\Di\SearchService` to be used for the search. This allows you to alter the search parameters in Elasticsearch.

Params contain:

- `search_params`: an array of the search parameters as provided by Elgg search

#### 'to:entity:before', 'elasticsearch'

[](#toentitybefore-elasticsearch)

Change the Elasticsearch hit data before it's converted to an `ElggEntity`

Params contain:

- `hit`: the result from Elasticsearch
- `search_params`: an array of the search parameters as provided by Elgg search

#### 'to:entity', 'elasticsearch'

[](#toentity-elasticsearch)

Return an `ElggEntity` based on the search result data from Elasticsearch.

Params contain:

- `hit`: the result from Elasticsearch
- `search_params`: an array of the search parameters as provided by Elgg search

### Parameters passed to `elgg_search`

[](#parameters-passed-to-elgg_search)

#### field\_boosting

[](#field_boosting)

In the parameters passed to `elgg_search` you can add a configuration to control field boosting in Elasticsearch. Add the key `field_boosting` to the array which holds an array with fieldname and the boosting for that field.

Example:

```
[
	'field_boosting' => [
		'title' => 2, // title is worth double
		'description' => 0.5 // description is worth half
	],
]
```

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 70.8% 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 ~71 days

Recently: every ~119 days

Total

32

Last Release

1557d ago

Major Versions

v2.0 → v3.02017-03-24

v3.6.1 → v4.02019-04-17

v4.2.2 → v5.02020-10-13

v5.0.3 → v6.02021-09-27

v6.0 → v7.02022-02-16

### Community

Maintainers

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

---

Top Contributors

[![jeabakker](https://avatars.githubusercontent.com/u/881958?v=4)](https://github.com/jeabakker "jeabakker (293 commits)")[![jdalsem](https://avatars.githubusercontent.com/u/861833?v=4)](https://github.com/jdalsem "jdalsem (121 commits)")

---

Tags

pluginsearchelasticsearchelgglucene

### Embed Badge

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

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

###  Alternatives

[10up/elasticpress

Supercharge WordPress with Elasticsearch.

1.3k395.7k17](/packages/10up-elasticpress)[mailerlite/laravel-elasticsearch

An easy way to use the official PHP ElasticSearch client in your Laravel applications.

936603.4k2](/packages/mailerlite-laravel-elasticsearch)[matchish/laravel-scout-elasticsearch

Search among multiple models with ElasticSearch and Laravel Scout

7491.7M3](/packages/matchish-laravel-scout-elasticsearch)[jeroen-g/explorer

Next-gen Elasticsearch driver for Laravel Scout.

399672.8k](/packages/jeroen-g-explorer)[mmanos/laravel-search

A search package for Laravel 5.

36275.7k1](/packages/mmanos-laravel-search)[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.5k10](/packages/helsingborg-stad-municipio)

PHPackages © 2026

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