PHPackages                             risototh/search-query-composer - 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. risototh/search-query-composer

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

risototh/search-query-composer
==============================

Tokenizer and composer for search query from user input.

1.2.0(3y ago)09.9kBSD-3-ClausePHPPHP &gt;=8.1

Since Mar 28Pushed 3y ago1 watchersCompare

[ Source](https://github.com/risototh/search-query-composer)[ Packagist](https://packagist.org/packages/risototh/search-query-composer)[ RSS](/packages/risototh-search-query-composer/feed)WikiDiscussions master Synced yesterday

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

Search Query Composer
=====================

[](#search-query-composer)

This library is intended for use in cases, where you want to extend the search abilities of simple search input. It takes the input from user, and tries to interpret them as an expression. For example, user enters something like **a AND NOT (b OR c)** and this library will tokenize this input and construct the valid SQL statement fragment like

```
`field` LIKE '%a%'
AND NOT(
  `field` LIKE '%b%'
  OR
  `field` LIKE '%c%'
)
```

Features
--------

[](#features)

- PSR-4 autoloading compliant structure
- Supports operators AND, OR, NOT
- Supports subquery nesting
- Easy to use

Use
---

[](#use)

Basic usage is very simple:

```
$userInput = 'a AND NOT (b OR c)';
$pdo = new \PDO('your pdo connection');
echo RisoToth\Database\SearchQuery::make($userInput, $pdo, '`field`');
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity76

Established project with proven stability

 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 ~466 days

Total

5

Last Release

1103d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.4

1.2.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/25a30f7fe0c21f6df3926f80babb9ee45ba8d6c8f6f09bd7069faec7ed93734b?d=identicon)[risototh](/maintainers/risototh)

---

Top Contributors

[![risototh](https://avatars.githubusercontent.com/u/800331?v=4)](https://github.com/risototh "risototh (2 commits)")

---

Tags

phpsearchdatabasesql

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/risototh-search-query-composer/health.svg)

```
[![Health](https://phpackages.com/badges/risototh-search-query-composer/health.svg)](https://phpackages.com/packages/risototh-search-query-composer)
```

###  Alternatives

[foolz/sphinxql-query-builder

A PHP query builder for SphinxQL and ManticoreQL with MySQLi and PDO drivers.

3232.2M32](/packages/foolz-sphinxql-query-builder)[clouddueling/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

1.3k22.9k](/packages/clouddueling-mysqldump-php)[codewithkyrian/chromadb-php

A PHP client for the Chroma Open Source Embedding Database

83290.2k9](/packages/codewithkyrian-chromadb-php)[druidfi/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

35489.8k6](/packages/druidfi-mysqldump-php)[butschster/dbml-parser

DBML (database markup language) parser written on PHP8.

6416.8k2](/packages/butschster-dbml-parser)[calebdw/laravel-sql-entities

Manage SQL entities in Laravel with ease.

301.3k](/packages/calebdw-laravel-sql-entities)

PHPackages © 2026

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