PHPackages                             rollerworks/search-processor - 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. rollerworks/search-processor

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

rollerworks/search-processor
============================

SearchProcess request handling for RollerworksSearch

v0.2.1(8y ago)12.3k1MITPHPPHP ^7.1

Since Feb 24Pushed 8y ago1 watchersCompare

[ Source](https://github.com/rollerworks-graveyard/search-processor)[ Packagist](https://packagist.org/packages/rollerworks/search-processor)[ RSS](/packages/rollerworks-search-processor/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (3)Dependencies (8)Versions (10)Used By (1)

RollerworksSearch SearchProcessor
=================================

[](#rollerworkssearch-searchprocessor)

This package provides SearchProcess request handlers for [RollerworksSearch](https://github.com/rollerworks/search). You need a PSR-7 compatible library to provide Request information to the processor.

The processors can be used with all supported input processors, condition exporters, and is usable for REST-API endpoints.

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

[](#installation)

To install this package, add `rollerworks/search-processor` to your composer.json

```
$ php composer.phar require rollerworks/search-processor
```

Now, Composer will automatically download all required files, and install them for you.

Basic usage
-----------

[](#basic-usage)

Each SearchProcessor works a `SearchPayload` that contains READ-ONLY information about the processing result.

A SearchProcessor is re-usable and lazily loads related dependencies. The loaders shown here don't allow custom input/condition-exporters, use a PSR-11 compatible implementation for this.

```
use Rollerworks\Component\Search\Searches;
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\Loader;
use Rollerworks\Component\Search\Processor\ProcessorConfig;
use Rollerworks\Component\Search\Processor\Psr7SearchProcessor;

// 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('gender', ChoiceType::class, [
        'choices' => ['Female' => 'f', 'Male' => 'm'],
    ])
    ->getFieldSet('users');

$inputProcessorLoader = Loader\InputProcessorLoader::create();
$conditionExporterLoader = Loader\ConditionExporterLoader::create();
$processor = new Psr7SearchProcessor($searchFactory, $inputProcessorLoader, $conditionExporterLoader);

$request = ...; // A PSR-7 ServerRequestInterface object instance

$processorConfig = new ProcessorConfig($userFieldSet);
$searchPayload = $processor->processRequest($request, $processorConfig);

// When a POST is provided the processor will validate the input
// and export it. Note that an empty result is also valid.
//
// The searchCode depends on the implementation of the SearchProcessor,
// and in this case contains a JSON exported SearchCondition encoded for URI usage.
if ($searchPayload->isChanged() && $searchPayload->isValid()) {
    // Redirect to this page with the search-code provided.
    header('Location: /search?search='.$searchPayload->searchCode);
    exit();
}

// Always do this check because searchCode could be malformed resulting in
// an invalid SearchCondition.
if (!$payload->isValid()) {
    // Each error message can be easily transformed to a localized version.
    // Read the documentation for more details.
    foreach ($payload->messages as $error) {
       echo (string) $error.PHP_EOL;
    }
}

// Notice: This is null when there are errors, when the condition is valid but has
// no fields/values this is an empty SearchCondition object.
$condition = $payload->searchCondition;
```

For better performance in a paginated search result the produced payload can be cached using the `CachedSearchProcessor` (which requires a PSR-16 SimpleCache implementation).

Versioning
----------

[](#versioning)

For transparency and insight into the release cycle, and for striving to maintain backward compatibility, this package is maintained under the Semantic Versioning guidelines as much as possible.

Releases will be numbered with the following format:

`..`

And constructed with the following guidelines:

- Breaking backward compatibility bumps the major (and resets the minor and patch)
- New additions without breaking backward compatibility bumps the minor (and resets the patch)
- Bug fixes and misc changes bumps the patch

For more information on SemVer, please visit .

License
-------

[](#license)

The source of this package is subject to the MIT license that is bundled with this source code in the file [LICENSE](LICENSE).

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

[](#contributing)

This is an open source project. If you'd like to contribute, please read the [Contributing Code](http://symfony.com/doc/current/contributing/code/index.html) part of Symfony for the basics. If you're submitting a pull request, please follow the guidelines in the [Submitting a Patch](http://symfony.com/doc/current/contributing/code/patches.html#check-list) section.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~43 days

Recently: every ~0 days

Total

8

Last Release

3114d ago

Major Versions

v0.2.1 → v2.0.0-ALPHA102017-12-21

### 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 (9 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rollerworks-search-processor/health.svg)

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

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.5k](/packages/aws-aws-sdk-php)[symfony/symfony

The Symfony PHP framework

31.4k87.2M2.2k](/packages/symfony-symfony)[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

8.0k1.1B3.9k](/packages/guzzlehttp-psr7)[elasticsearch/elasticsearch

PHP Client for Elasticsearch

5.3k187.3M1.1k](/packages/elasticsearch-elasticsearch)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k36](/packages/neuron-core-neuron-ai)[algolia/algoliasearch-client-php

API powering the features of Algolia.

69735.1M151](/packages/algolia-algoliasearch-client-php)

PHPackages © 2026

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