PHPackages                             brighttalk/acs-query-builder - 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. brighttalk/acs-query-builder

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

brighttalk/acs-query-builder
============================

Provides an object oriented way to programmatically build queries for the Amazon Cloud Search service

0.5.0(11y ago)912.8k3[1 issues](https://github.com/BrightTALK/acs-query-builder/issues)1BSD-2-ClausePHPPHP &gt;=5.3.3CI failing

Since Mar 24Pushed 11y ago9 watchersCompare

[ Source](https://github.com/BrightTALK/acs-query-builder)[ Packagist](https://packagist.org/packages/brighttalk/acs-query-builder)[ Docs](http://www.brighttalk.com)[ RSS](/packages/brighttalk-acs-query-builder/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (2)Versions (9)Used By (1)

Amazon Cloud Search Query Builder
=================================

[](#amazon-cloud-search-query-builder)

[![Build Status](https://camo.githubusercontent.com/e4f4cbbcf2a6ada50a4e457af7284f7bef5a05e55ccab7ef5d67c6845f5b4852/68747470733a2f2f7472617669732d63692e6f72672f42726967687454414c4b2f6163732d71756572792d6275696c6465722e706e67)](https://travis-ci.org/BrightTALK/acs-query-builder)

Description
-----------

[](#description)

This library provides an object oriented way to programmatically build queries for the Amazon Cloud Search service. It's inspired by Doctrine's query builder. A query's \_\_toString method will return a decoded string, as provided by the http\_build\_query function

\##Installation

Add to your composer.json:

```
"require": {
    ...
    "brighttalk/acs-query-builder": "dev-master"
}

```

Working with the Query Builder
------------------------------

[](#working-with-the-query-builder)

```
$query = $qb->searchByFieldValue("fieldName", "'fieldValue'")
    ->setSize(20)
    ->setStart(0)
    ->setRank('-fieldName')
    ->getQuery();

echo $query;
```

would output bq=fieldName:'fieldValue'&amp;start=0&amp;size=20&amp;rank=-fieldName (the "-" in the rank expression means it is in descending order - see the [Amazon docs](http://docs.aws.amazon.com/cloudsearch/latest/developerguide/sortingresults.html) )

The ExpressionBuilder
---------------------

[](#the-expressionbuilder)

The supported expressions are: andX, orX, notX, eq

Example:

```
$query = $qb->setSearchExpression($qb->expr()->andx(
        $qb->expr()->eq("aFieldName", "'aFieldValue'"),
        $qb->expr()->notx($qb->expr()->eq("anotherFieldName", "'anotherFieldValue'"))
    ))
    ->setSize(20)
    ->setStart(0)
    ->getQuery();

echo $query;
```

would output bq=(and afieldName:'afieldValue' (not anotherFieldName:'anotherFieldValue'))&amp;start=0&amp;size=20

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Total

5

Last Release

4178d ago

### Community

Maintainers

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

---

Top Contributors

[![andrewtarry](https://avatars.githubusercontent.com/u/1941015?v=4)](https://github.com/andrewtarry "andrewtarry (6 commits)")[![ricoli](https://avatars.githubusercontent.com/u/1648125?v=4)](https://github.com/ricoli "ricoli (5 commits)")[![andrewtarrybt](https://avatars.githubusercontent.com/u/9610512?v=4)](https://github.com/andrewtarrybt "andrewtarrybt (2 commits)")[![nathanlon](https://avatars.githubusercontent.com/u/169887?v=4)](https://github.com/nathanlon "nathanlon (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/brighttalk-acs-query-builder/health.svg)

```
[![Health](https://phpackages.com/badges/brighttalk-acs-query-builder/health.svg)](https://phpackages.com/packages/brighttalk-acs-query-builder)
```

###  Alternatives

[ircmaxell/filterus

A library for filtering variables in PHP

44613.4k6](/packages/ircmaxell-filterus)[awesome-nova/dependent-filter

Dependent filters for Laravel Nova

26190.2k](/packages/awesome-nova-dependent-filter)

PHPackages © 2026

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