PHPackages                             reliefweb/api-indexer - 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. [API Development](/categories/api)
4. /
5. reliefweb/api-indexer

ActiveLibrary[API Development](/categories/api)

reliefweb/api-indexer
=====================

Standalone library to index the RW database into the API elasticsearch indexes.

v3.1.1(2mo ago)05.7k[1 PRs](https://github.com/UN-OCHA/rwint-api-indexer/pulls)PHPPHP &gt;=8.5CI failing

Since May 20Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/UN-OCHA/rwint-api-indexer)[ Packagist](https://packagist.org/packages/reliefweb/api-indexer)[ RSS](/packages/reliefweb-api-indexer/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (58)Used By (0)

api-indexer
===========

[](#api-indexer)

Standalone application to index the content of the RW database into the API elasticsearch indexes without Drupal.

Command line
------------

[](#command-line)

```
Usage: php PATH/TO/Indexer.php [options]
    -h, --help display this help
    -e, --elasticsearch  Elasticsearch URL, defaults to http://127.0.0.1:9200
    -H, --mysql-host  Mysql host, defaults to localhost
    -P, --mysql-port  Mysql port, defaults to 3306
    -u, --mysql-user  Mysql user, defaults to root
    -p, --mysql-pass  Mysql pass, defaults to none
    -d, --database  Database name, deaults to reliefwebint_0
    -b, --base-index-name  Base index name, deaults to reliefwebint_0
    -t, --tag  Tag appended to the index name, defaults to empty string
    -w, --website  Website URL, deaults to https://reliefweb.int
    -l, --limit  Maximum number of entities to index, defaults to 0 (all)
    -o, --offset  ID of the entity from which to start the indexing, defaults to the most recent one
    -f, --filter  Filter documents to index. Format: 'field1:value1,value2+field2:value1,value2'
    -c, --chunk-size  Number of entities to index at one time, defaults to 500
    -i, --id Id of an entity item to index, defaults to 0 (none)
    -r, --remove Removes an entity if 'id' is provided or the index for the given entity bundle
    -a, --alias Set up the alias for the index after the indexing, ignored if id is provided
    -A, --alias-only Set up the alias for the index without indexing, ignored if id is provided

```

Library
-------

[](#library)

Add the library with composer:

```
composer require "reliefweb/api-indexer"
```

And then create a new Manager, providing an options array (see above for the options using their fullname):

```
use RWAPIIndexer\Manager;

// Indexing options to index all reports.
$options = array(
  'bundle' => 'report',
  'elasticsearch' => 'http://127.0.0.1:9200',
  'mysql-host' => 'localhost',
  'mysql-port' => 3306,
  'mysql-user' => 'root',
  'mysql-pass' => '',
  'database' => 'DATABASE_NAME',
  'base-index-name' => 'ELASTICSEARCH_INDEX_PREFIX',
  'tag' => '',
  'website' => 'https://reliefweb.int',
  'limit' => 0,
  'offset' => 0,
  'chunk-size' => 500,
  'id' => 0,
  'remove' => FALSE,
  'alias' => TRUE,
);

// Create the indexing manager.
$manager = new Manager($options);

// Index or delete based on the provided options.
$manager->execute();
```

Markdown
--------

[](#markdown)

It's recommended to have php-hoedown installed. If not, the indexer will default to the PHP League CommonMark library which is slower.

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance87

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity94

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 95.5% 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 ~70 days

Recently: every ~45 days

Total

52

Last Release

70d ago

Major Versions

v1.20.0 → v2.0.02022-01-19

v2.10.0 → v3.0.02026-02-17

PHP version history (3 changes)v1.0.0PHP &gt;=5.3.3

v2.0.0PHP &gt;=8.0

v3.0.0PHP &gt;=8.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/346443feed98de86efcea04bbc5094dc2a4146181bca1e8936beb6ac46eed455?d=identicon)[unocha](/maintainers/unocha)

---

Top Contributors

[![orakili](https://avatars.githubusercontent.com/u/696348?v=4)](https://github.com/orakili "orakili (191 commits)")[![lazysoundsystem](https://avatars.githubusercontent.com/u/67453?v=4)](https://github.com/lazysoundsystem "lazysoundsystem (5 commits)")[![cafuego](https://avatars.githubusercontent.com/u/148719?v=4)](https://github.com/cafuego "cafuego (3 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

apielasticsearchreliefweb

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/reliefweb-api-indexer/health.svg)

```
[![Health](https://phpackages.com/badges/reliefweb-api-indexer/health.svg)](https://phpackages.com/packages/reliefweb-api-indexer)
```

###  Alternatives

[phpdocumentor/phpdocumentor

Documentation Generator for PHP

4.4k3.1M878](/packages/phpdocumentor-phpdocumentor)[m165437/laravel-blueprint-docs

API Blueprint Renderer for Laravel

22779.0k](/packages/m165437-laravel-blueprint-docs)[mikemadisonweb/yii2-elasticsearch

Yii2 extension for integration with Elasticsearch version 5.0 and above.

153.9k](/packages/mikemadisonweb-yii2-elasticsearch)

PHPackages © 2026

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