PHPackages                             locomotivemtl/charcoal-contrib-search - 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. locomotivemtl/charcoal-contrib-search

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

locomotivemtl/charcoal-contrib-search
=====================================

Charcoal search module.

0.3.3.1(3mo ago)0102MITPHPPHP &gt;=7.0CI failing

Since Apr 29Pushed 3mo ago9 watchersCompare

[ Source](https://github.com/locomotivemtl/charcoal-contrib-search)[ Packagist](https://packagist.org/packages/locomotivemtl/charcoal-contrib-search)[ Docs](https://locomotivemtl.github.io/charcoal-contrib-search/)[ RSS](/packages/locomotivemtl-charcoal-contrib-search/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (5)Versions (16)Used By (0)

Charcoal Search
===============

[](#charcoal-search)

[![License](https://camo.githubusercontent.com/5c97d2d41cfb404210c4001dbf6f2710cce4c08795fa76c4b2c7427f2a88be7c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c6f636f6d6f746976656d746c2f63686172636f616c2d636f6e747269622d7365617263682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/locomotivemtl/charcoal-contrib-search)[![Latest Stable Version](https://camo.githubusercontent.com/6deae3e1016b2236e56fe67d57746cf6e8ed66a4f3b8157aa5d5aeeba0a22084/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6f636f6d6f746976656d746c2f63686172636f616c2d636f6e747269622d7365617263682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/locomotivemtl/charcoal-contrib-search)

A [Charcoal](https://packagist.org/packages/locomotivemtl/charcoal-app) service provider my cool feature.

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
    - [Dependencies](#dependencies)
- [Configuration](#configuration)
- [Usage](#usage)
- [Development](#development)
    - [API Documentation](#api-documentation)
    - [Development Dependencies](#development-dependencies)
    - [Coding Style](#coding-style)
- [Credits](#credits)
- [License](#license)

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

[](#installation)

The preferred (and only supported) method is with Composer:

```
$ composer require locomotivemtl/charcoal-contrib-search
```

### Dependencies

[](#dependencies)

#### Required

[](#required)

- [**PHP 5.6+**](https://php.net): *PHP 7* is recommended.
- [**guzzlehttp/guzzle**](https://github.com/guzzle/guzzle): 6 or 7
- [**charcoal-admin**](https://github.com/locomotivemtl/charcoal-admin): &gt;=0.14
- [**charcoal-contrib-sitemap**](https://github.com/locomotivemtl/charcoal-contrib-sitemap): &gt;=0.1.5

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

[](#configuration)

In your project's config file, require the search module :

```
{
    "modules": {
        "charcoal/search/search": {}
    }
}
```

Usage
-----

[](#usage)

The module adds a `search` route action using GET. You may access [http://project-url.com/search?keyword=\[keyword\]](http://project-url.com/search?keyword=%5Bkeyword%5D). You won't get any results until you run the IndexContent Script.

Before running the script, you need to setup

```
// Once a day at midnight
// You need to precise the base URL as it won'T be provided by the cli
0 0 * * * cd /[project]/web && /usr/local/bin/php /[project]/web/vendor/bin/charcoal admin/search/index-content -u http://project-url.com/

```

Each object of the sitemap to index must include `data.id` and `data.objType` to be indexable:

```
{
    "sitemap": {
        "xml": {
            "l10n": true,
            "check_active_routes": true,
            "relative_urls": false,
            "objects": {…}
        },
        "searchables": {
            "l10n": true,
            "check_active_routes": true,
            "relative_urls": false,
            "transformer": "charcoal/search/transformer/indexable",
            "objects": {
                "app/object/section": {
                    "filters": {…},
                    "data": {
                        "id": "{{id}}",
                        "objType": "{{objType}}"
                    }
                },
                …
            }
        }
    }
}
```

### Parameters

[](#parameters)

- `-u` (`--url`) Website URL. Necessary as this is run in a cron script.
- `-c` (`--config`) Sitemap builder key (Defaults to `xml`).
- `-n` (`--no_index_class`) Class to filter out content from the crawled pages. Defaults to `php-no_index`.
- `-i` (`--index_element_id`) ID of the element to be indexed in the crawled page. Defaults to entire page body.

Development
-----------

[](#development)

### API Documentation

[](#api-documentation)

- The auto-generated `phpDocumentor` API documentation is available at:

- The auto-generated `apigen` API documentation is available at:
    [https://codedoc.pub/locomotivemtl/charcoal-contrib-search/master/](https://codedoc.pub/locomotivemtl/charcoal-contrib-search/master/index.html)

### Development Dependencies

[](#development-dependencies)

- \[php-coveralls/php-coveralls\]\[phpcov\]
- \[phpunit/phpunit\]\[phpunit\]
- \[squizlabs/php\_codesniffer\]\[phpcs\]

### Coding Style

[](#coding-style)

The charcoal-contrib-search module follows the Charcoal coding-style:

- [*PSR-1*](https://www.php-fig.org/psr/psr-1/)
- [*PSR-2*](https://www.php-fig.org/psr/psr-2/)
- [*PSR-4*](https://www.php-fig.org/psr/psr-4/), autoloading is therefore provided by *Composer*.
- [*phpDocumentor*](http://phpdoc.org/) comments.
- [phpcs.xml.dist](phpcs.xml.dist) and [.editorconfig](.editorconfig) for coding standards.

> Coding style validation / enforcement can be performed with `composer phpcs`. An auto-fixer is also available with `composer phpcbf`.

Credits
-------

[](#credits)

- [Locomotive](https://locomotive.ca/)

License
-------

[](#license)

Charcoal is licensed under the MIT license. See [LICENSE](LICENSE) for details.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance82

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 72% 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 ~176 days

Recently: every ~152 days

Total

15

Last Release

96d ago

PHP version history (2 changes)0.1PHP &gt;=5.6.0 || &gt;=7.0

0.3PHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/4229f19eecd12c2b651b6502dcc5adfba48c5770db3d2dbea55fc92c7a246b2b?d=identicon)[BeneRoch](/maintainers/BeneRoch)

---

Top Contributors

[![BeneRoch](https://avatars.githubusercontent.com/u/3017380?v=4)](https://github.com/BeneRoch "BeneRoch (18 commits)")[![mcaskill](https://avatars.githubusercontent.com/u/29353?v=4)](https://github.com/mcaskill "mcaskill (7 commits)")

---

Tags

charcoal

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/locomotivemtl-charcoal-contrib-search/health.svg)

```
[![Health](https://phpackages.com/badges/locomotivemtl-charcoal-contrib-search/health.svg)](https://phpackages.com/packages/locomotivemtl-charcoal-contrib-search)
```

###  Alternatives

[algolia/algoliasearch-magento-2

Algolia Search &amp; Discovery extension for Magento 2

1881.8M16](/packages/algolia-algoliasearch-magento-2)[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)
