PHPackages                             rollersearch/search-dev - 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. [Database &amp; ORM](/categories/database)
4. /
5. rollersearch/search-dev

ActiveProject[Database &amp; ORM](/categories/database)

rollersearch/search-dev
=======================

Rollersearch (former RollerworksSearch) monolith development (use separate packages instead)

v1.2.1(9y ago)112018[4 issues](https://github.com/rollersearch/search/issues)MITPHPPHP &gt;=5.4CI passing

Since Jun 18Pushed 1mo ago5 watchersCompare

[ Source](https://github.com/rollersearch/search)[ Packagist](https://packagist.org/packages/rollersearch/search-dev)[ Docs](https://rollerworks.github.io/)[ RSS](/packages/rollersearch-search-dev/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (59)Used By (0)

RollerworksSearch
=================

[](#rollerworkssearch)

About RollerworksSearch
-----------------------

[](#about-rollerworkssearch)

RollerworksSearch is a powerful search-system for PHP. Created to make searching in a PHP powered application as simple and fast as possible.

Whether you want to search for users in your SQL database, want to provide a powerful search system for searching products using an ElasticSearch back-end, or are looking for a way to abstract filtering for a reporter.

Important

RollerworksSearch v2.0 is fully not stable yet, a stable release is expected no later than 31th of March 2026.

Feel free to try out the project and report any issues you find.

Warning

Elasticsearch support is [currently broken](https://github.com/rollersearch/search/issues/347)and might not be fixed until the next stable release (after v2.0.0).

### How about complex data structures?

[](#how-about-complex-data-structures)

A complex data is structure is no problem, say your customer data is stored in the "customer" table, the "invoices" data is stored in it's own table, and the details of the invoices have there own table.

Instead of writing a very verbose SQL query, your users can use the easy to learn StringQuery syntax:

> `invoice-price: > $20.00; invoice-row-label: ~*"my cool product"; customer-type: !consumer`.

You just searched in three relational tables using a single condition with a user-friendly syntax. And that is just the start, RollerworksSearch can work with any locale, custom input format, or storage system.

Search conditions can be as simple or complex as you need them to be. Including grouping and nesting for the best possible result.

Features
--------

[](#features)

RollerworksSearch provides you with most of the features you can expect from a search system, including:

- Localized input processing using the StringQuery format;
- User-friendly format validation;
- Integration with API-Platform;
- Integration for Symfony 6.4 and up (Symfony Flex supported).

And support for the most poplar storage systems.

- [Doctrine DBAL](https://github.com/rollerworks/search-doctrine-dbal)
- [Doctrine ORM](https://github.com/rollerworks/search-doctrine-orm)
- [ElasticSearch](https://github.com/rollerworks/search-elasticsearch)

Installation and usage
----------------------

[](#installation-and-usage)

*Please ignore the instructions below if your use a framework integration.*

[Read the Documentation](http://rollerworkssearch.readthedocs.org/en/latest/) for complete instructions and information.

Install the RollerworksSearch "core" library using [Composer](https://getcomposer.org/doc/00-intro.md):

```
$ composer install rollerworks/search
```

And create the `SearchFactory` to get started.

```
use Rollerworks\Component\Search\Searches;
use Rollerworks\Component\Search\Exception\InvalidSearchConditionException;
use Rollerworks\Component\Search\Extension\Core\Type\TextType;
use Rollerworks\Component\Search\Extension\Core\Type\IntegerType;
use Rollerworks\Component\Search\Extension\Core\Type\ChoiceType;
use Rollerworks\Component\Search\Input\ErrorPathTranslator;
use Rollerworks\Component\Search\Input\StringQueryInput;
use Rollerworks\Component\Search\Input\ProcessorConfig;

// The factory is reusable, you create it only once.
$searchFactory = Searches::createSearchFactory();

// Create a fieldset to inform the system about your configuration.
// Usually you will have a FieldSet for each data structure (users, invoices, etc).
$userFieldSet = $searchFactory->createFieldSetBuilder()
    ->add('firstName', TextType::class)
    ->add('lastName', TextType::class)
    ->add('age', IntegerType::class)
    ->add('type', ChoiceType::class, [
        'choices' => ['Consumer' => 'c', 'Business' => 'b'],
    ])
    ->getFieldSet('users');

// Now lets process a string query.
// Tip: the input processor is reusable.
$inputProcessor = new StringQueryInput();

try {
    // The ProcessorConfig allows to limit the amount of values, groups
    // and maximum nesting level. The defaults should be restrictive enough
    // for most situations.
    $processorConfig = new ProcessorConfig($userFieldSet);

    // The `process` method processes the input and produces
    // a valid SearchCondition (or throws an exception when something is wrong).
    $condition = $inputProcessor->process('firstName: sebastiaan, melany;');
} catch (InvalidSearchConditionException $e) {
    // Each error message can be transformed to a localized version
    // using the Symfony Translator contract.

    $translator = ...; // \Symfony\Contracts\Translation\TranslatorInterface

    // Note: The ErrorPathHumanizer only works for the `StringQueryInput` input processor.
    $errorPathHumanizer = new ErrorPathTranslator($translator);

    foreach ($e->getErrors() as $error) {
       echo '' $errorPathHumanizer->humanize($error->path) .  ' ' . htmlentities($error->trans($translator), ENT_COMPAT | ENT_IGNORE, 'UTF-8') '' . PHP_EOL;
    }
}
```

That's it! The `$condition` contains the SearchCondition in a normalized data format which can be used in a condition processor (like ElasticSearch), or be exported into another format like JSON for easier usage in a URL.

> **Note:** RollerworksSearch is composed of multiple separate packages (to keep the architecture slim), the "core" package provides everything you need to get started.
>
> Searching a (document) storage requires the installation of additional packages.

### What about validation?

[](#what-about-validation)

Each field type ensures the value is transformed to the correct format, either a date input is automatically transformed to a `DateTimeImuttable` object.

A field that expects an integer will fail when the provided input is not an integer.

To enforce more strict constraints like a maximum amount for an integer field you can use the [Symfony Validator extension](https://rollerworkssearch.readthedocs.io/en/latest/integration/symfony_validator.html).

Resources
---------

[](#resources)

- [Read the Documentation](http://rollerworkssearch.readthedocs.org/en/latest/)
- RollerworksSearch is maintained under the [Semantic Versioning guidelines](http://semver.org/)

Who is behind RollerworksSearch?
--------------------------------

[](#who-is-behind-rollerworkssearch)

RollerworksSearch is brought to you by [Sebastiaan Stok](https://github.com/sstok).

License
-------

[](#license)

RollerworksSearch is released under the [MIT license](LICENSE).

The types and extensions are largely inspired on the Symfony Form Component, and contain a big amount of code from the Symfony project.

Support
-------

[](#support)

Use the issue tracker to create a new [support question](https://github.com/rollerworks/search/issues/new?labels=Question+%2F+Support&template=3_Support_question.md).

**Note:** Please be patient, it might take some time before your question is answered. **Do not ping the maintainers.**

Contributing
------------

[](#contributing)

This is an open source project. If you'd like to contribute, please read the [Contributing Guidelines](https://github.com/rollerworks/contributing). If you're submitting a pull request, please follow the guidelines in the [Submitting a Patch](https://contributing.readthedocs.org/en/latest/code/patches.html) section.

**Note:** RollerworksSearch is developed in a monolith repository, do not open pull request against repositories marked as `[READ-ONLY]`, thank you.

###  Health Score

44

—

FairBetter than 91% of packages

Maintenance58

Moderate activity, may be stable

Popularity17

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 98.2% 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 ~75 days

Recently: every ~18 days

Total

58

Last Release

50d ago

Major Versions

1.x-dev → v2.0.0-ALPHA12017-03-04

v0.2.0 → v2.0.0-ALPHA32017-08-06

v0.3.0 → v2.0.0-ALPHA52017-08-25

v0.3.1 → v2.0.0-ALPHA72017-10-23

v0.1.0 → v2.0.0-ALPHA62017-12-21

PHP version history (7 changes)v1.0.0-beta1PHP &gt;=5.3.3

v1.0.0-beta5PHP &gt;=5.4

v2.0.0-ALPHA1PHP ^7.1

v2.0.0-ALPHA23PHP ^7.2

v2.0.0-BETA2PHP &gt;=7.4

v2.0.0-BETA3PHP &gt;=8.1

v2.0.0-BETA13PHP ^8.1

### Community

Maintainers

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

---

Top Contributors

[![sstok](https://avatars.githubusercontent.com/u/904790?v=4)](https://github.com/sstok "sstok (1783 commits)")[![dkarlovi](https://avatars.githubusercontent.com/u/209225?v=4)](https://github.com/dkarlovi "dkarlovi (20 commits)")[![jkabat](https://avatars.githubusercontent.com/u/6071927?v=4)](https://github.com/jkabat "jkabat (4 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (3 commits)")[![milosa](https://avatars.githubusercontent.com/u/2864243?v=4)](https://github.com/milosa "milosa (2 commits)")[![greg0ire](https://avatars.githubusercontent.com/u/657779?v=4)](https://github.com/greg0ire "greg0ire (1 commits)")[![cordoval](https://avatars.githubusercontent.com/u/328359?v=4)](https://github.com/cordoval "cordoval (1 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (1 commits)")[![gitter-badger](https://avatars.githubusercontent.com/u/8518239?v=4)](https://github.com/gitter-badger "gitter-badger (1 commits)")

---

Tags

doctrineelasticsearchphprollerscapesrollersearchrollerworksrollerworkssearchsearchsymfonysearchfilterrollerworks

### Embed Badge

![Health badge](/badges/rollersearch-search-dev/health.svg)

```
[![Health](https://phpackages.com/badges/rollersearch-search-dev/health.svg)](https://phpackages.com/packages/rollersearch-search-dev)
```

###  Alternatives

[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[mohammad-fouladgar/eloquent-builder

527189.5k](/packages/mohammad-fouladgar-eloquent-builder)[mehdi-fathi/eloquent-filter

Eloquent Filter adds custom filters automatically to your Eloquent Models in Laravel.It's easy to use and fully dynamic, just with sending the Query Strings to it.

450191.6k1](/packages/mehdi-fathi-eloquent-filter)[jedrzej/searchable

Searchable trait for Laravel's Eloquent models - filter your models using request parameters

127259.1k4](/packages/jedrzej-searchable)[jedrzej/pimpable

Laravel 4/5/6 package that allows to dynamically filter, sort and eager load relations for your models using request parameters

105179.0k1](/packages/jedrzej-pimpable)

PHPackages © 2026

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