PHPackages                             danbettles/sequin - 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. danbettles/sequin

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

danbettles/sequin
=================

A simple PHP library for building query-strings for Lucene-based search engines (e.g. Solr)

1.0.0(13y ago)4281MITPHPPHP &gt;=5.3.1

Since Sep 26Pushed 12y ago2 watchersCompare

[ Source](https://github.com/danbettles/sequin)[ Packagist](https://packagist.org/packages/danbettles/sequin)[ Docs](https://github.com/danbettles/sequin)[ RSS](/packages/danbettles-sequin/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

\#Sequin#

N.B. This GitHub-hosted version of Sequin supercedes the one still available on SourceForge (), the original.

Sequin is a simple PHP library for building query-strings for Lucene-based search engines (e.g. Solr).

Query-strings are assembled using the fluent interface exposed by Sequin's `Query` class. An instance of `Query` comprises one or more `Term` objects, each of which may be a subquery—and each of those may also be further subdivided.

\##Requirements##

Sequin requires PHP version 5.3 or later; it uses no third-party libraries.

\##Installation (via Composer)##

Include the following in your `composer.json` file:

```
require:
{
    ...
    'danbettles/sequin': 'dev-master'
}

```

Then, run `composer.phar update`

\##Installation (manual)##

1. Download/clone the library.
2. Import the code into your application by `include`ing `src/boot.php`.

\##Usage##

The following—only slightly contrived—example demonstrates a good selection of Sequin's features. Here we build a query-string to search for soundtracks by Thomas Newman in the index of an imaginary online music retailer.

```
require_once 'path/to/sequin/src/boot.php';

$oQuery = Sequin\Query::newInstance('"Thomas Newman"')
    ->andTerm('soundtrack', null, 3)
    ->andQuery('music', 'dept')
        ->orTerm('film')
    ->endQuery()
    ->notTerm('"Erin Brockovich"');

print $oQuery;  // => "Thomas Newman" AND soundtrack^3 AND dept:(music OR film) NOT "Erin Brockovich"

```

\##Contribute##

Let me know if you find the library useful or you'd like to contribute—you're welcome.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

4978d ago

### Community

Maintainers

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

---

Top Contributors

[![caseyamcl](https://avatars.githubusercontent.com/u/53035?v=4)](https://github.com/caseyamcl "caseyamcl (3 commits)")

---

Tags

searchquerybuildersolrlucene

### Embed Badge

![Health badge](/badges/danbettles-sequin/health.svg)

```
[![Health](https://phpackages.com/badges/danbettles-sequin/health.svg)](https://phpackages.com/packages/danbettles-sequin)
```

###  Alternatives

[solarium/solarium

PHP Solr client

93532.7M98](/packages/solarium-solarium)[netgen/query-translator

Query Translator is a search query translator with AST representation

2042.0M6](/packages/netgen-query-translator)[minimalcode/search

Fluent Lucene-Sorl Query Builder for PHP

26501.8k6](/packages/minimalcode-search)[nelmio/solarium-bundle

Integration with solarium solr client.

1493.0M12](/packages/nelmio-solarium-bundle)[apache-solr-for-typo3/solr

Apache Solr for TYPO3 - Apache Solr for TYPO3 is the enterprise search server you were looking for with special features such as Faceted Search or Synonym Support and incredibly fast response times of results within milliseconds.

1473.0M32](/packages/apache-solr-for-typo3-solr)[dmk/mksearch

Generic highly adjustable and extendable search engine framework, using Zend Lucene, Apache Solr or ElasticSearch. But support for other search engines can be provided easily.

1330.6k](/packages/dmk-mksearch)

PHPackages © 2026

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