PHPackages                             pimcore/search-query-parser - 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. pimcore/search-query-parser

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

pimcore/search-query-parser
===========================

Parses a simplified SQL-like query string into a syntax tree which can be used to build search queries

v2026.1.0(2mo ago)14558.3k↓43.3%1[1 issues](https://github.com/pimcore/search-query-parser/issues)1proprietaryPHPPHP &gt;=8.0

Since Jan 19Pushed 2w ago9 watchersCompare

[ Source](https://github.com/pimcore/search-query-parser)[ Packagist](https://packagist.org/packages/pimcore/search-query-parser)[ RSS](/packages/pimcore-search-query-parser/feed)WikiDiscussions 2026.x Synced 2d ago

READMEChangelog (7)Dependencies (6)Versions (32)Used By (1)

SearchQueryParser
=================

[](#searchqueryparser)

[![Build Status](https://camo.githubusercontent.com/37025273ab767da39686013d6e72748e4c9a928498c85f593472ea56aad6a735/68747470733a2f2f7472617669732d63692e6f72672f70696d636f72652f7365617263682d71756572792d7061727365722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/pimcore/search-query-parser)

A basic search query parsing library which can be used to transform free-text searches into SQL (or other) queries. The analyzed search query can be used to build complex (SQL) queries, searching for a term in multiple fields. Take a look at the [`Zend_Db` end to end test](test/ZendDbEndToEndTest.php#L71) an example or have a look into [examples/](examples/) for working examples.

Syntax
------

[](#syntax)

Search terms can be AND/OR combined, negated, grouped with parentheses and modified to fuzzy exact search with the following syntax:

- `foo`
- `foo* AND bar`
- `*foo* OR *bar*`
- `*foo* OR !*bar*`
- `*foo* AND bar`
- `foo OR (bar AND baz)`

### Modifiers

[](#modifiers)

Fuzzy search: `**`
Negation: `! !() !*`

Usage
-----

[](#usage)

```
