PHPackages                             getdkan/lunr.php - 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. getdkan/lunr.php

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

getdkan/lunr.php
================

1.0.1(6y ago)58.5k1[3 issues](https://github.com/GetDKAN/lunr.php/issues)[2 PRs](https://github.com/GetDKAN/lunr.php/pulls)1PHPCI failing

Since Jul 11Pushed 6y ago1 watchersCompare

[ Source](https://github.com/GetDKAN/lunr.php)[ Packagist](https://packagist.org/packages/getdkan/lunr.php)[ RSS](/packages/getdkan-lunrphp/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (2)Versions (4)Used By (1)

Lunr Index Generator for PHP
============================

[](#lunr-index-generator-for-php)

[![CircleCI](https://camo.githubusercontent.com/3a7a66118027d89102eb120b26346e2ab839e001f2b860e58464567cc966c36c/68747470733a2f2f636972636c6563692e636f6d2f67682f476574444b414e2f6c756e722e7068702e7376673f7374796c653d737667)](https://circleci.com/gh/GetDKAN/lunr.php)[![Maintainability](https://camo.githubusercontent.com/e3984eea65c5a478772148b261a903eea2a5a72e661c83a1477a00552e29d713/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f33326561376530663930646166663931373030382f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/GetDKAN/lunr.php/maintainability)[![Test Coverage](https://camo.githubusercontent.com/9f8b44cb246932096620bfc72d32c534ff6377009707bf89fd2f8890dd58779a/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f33326561376530663930646166663931373030382f746573745f636f766572616765)](https://codeclimate.com/github/GetDKAN/lunr.php/test_coverage)

This project creates an index for Lunr.js in PHP. This will allow you to generate a Lunr.js endpoint in a PHP application.

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

[](#installation)

`composer install`

Tests
-----

[](#tests)

Run:

`./vendor/bin/phpunit`

Usage
-----

[](#usage)

Generating an index is similar to Lunr.js.

```
  // Instantiate the builder.
  $build = new BuildLunrIndex();
  // Add a unique id.
  $build->ref('identifier');
  // Add fields.
  $build->field("title");
  $build->field("description");
  // Add transforms to the pipeline.
  $pipeline->add('LunrPHP\LunrDefaultPipelines::trimmer');
  $pipeline->add('LunrPHP\LunrDefaultPipelines::stop_word_filter');
  $pipeline->add('LunrPHP\LunrDefaultPipelines::stemmer');
 // Load docs.
  $string = file_get_contents("./fixtures/fixture.json");
  $datasets = json_decode($string, true);
  // Add documents to the index.
  foreach ($datasets as $dataset) {
    $build->add($dataset);
  }

  // Output the index.
  $output = $build->output();

  // Place wherever.
  echo json_encode($output, JSON_PRETTY_PRINT);
```

Pipelines
---------

[](#pipelines)

There is a simple Pipelines class to run transforms on the terms during indexing. See `src/pipelines.php` for included pipelines.

Missing Features
----------------

[](#missing-features)

This index is missing boosts and several other indexing features.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance8

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 70.6% 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 ~82 days

Total

2

Last Release

2417d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2f0d92fbf723138c5371b7bea3cfd623ceffd135864015c965e4379c8bfda37b?d=identicon)[dafeder](/maintainers/dafeder)

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

![](https://www.gravatar.com/avatar/322fa17d81a64cec51cc1cd342159034534105169a336b4cb0145bfd1467aa1e?d=identicon)[dgading](/maintainers/dgading)

![](https://www.gravatar.com/avatar/51a4c0ebad087ab9cbfdc6675d7d8ed57fc988259e8b2d62b6b0387c37a48eb7?d=identicon)[acouch](/maintainers/acouch)

---

Top Contributors

[![acouch](https://avatars.githubusercontent.com/u/512243?v=4)](https://github.com/acouch "acouch (12 commits)")[![dgading](https://avatars.githubusercontent.com/u/2748839?v=4)](https://github.com/dgading "dgading (2 commits)")[![fmizzell](https://avatars.githubusercontent.com/u/5494584?v=4)](https://github.com/fmizzell "fmizzell (2 commits)")[![janette](https://avatars.githubusercontent.com/u/314172?v=4)](https://github.com/janette "janette (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/getdkan-lunrphp/health.svg)

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

###  Alternatives

[ruflin/elastica

Elasticsearch Client

2.3k50.4M203](/packages/ruflin-elastica)[opensearch-project/opensearch-php

PHP Client for OpenSearch

15024.3M65](/packages/opensearch-project-opensearch-php)[mailerlite/laravel-elasticsearch

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

934529.3k2](/packages/mailerlite-laravel-elasticsearch)[massive/search-bundle

Massive Search Bundle

721.4M13](/packages/massive-search-bundle)[shyim/opensearch-php-dsl

OpenSearch/Elasticsearch DSL library

175.9M9](/packages/shyim-opensearch-php-dsl)[outl1ne/nova-multiselect-filter

Multiselect filter for Laravel Nova.

45802.7k3](/packages/outl1ne-nova-multiselect-filter)

PHPackages © 2026

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