PHPackages                             terry/easysolr - 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. [API Development](/categories/api)
4. /
5. terry/easysolr

ActiveLibrary[API Development](/categories/api)

terry/easysolr
==============

EasySolr is a Solr api wrapper for PHP

0.1.0(6y ago)16MITPHPPHP &gt;=5.5

Since Dec 27Pushed 6y ago1 watchersCompare

[ Source](https://github.com/debug2012/easysolr)[ Packagist](https://packagist.org/packages/terry/easysolr)[ Docs](http://debug2012.github.io/)[ RSS](/packages/terry-easysolr/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

> ### install by composer
>
> [](#install-by-composer)

```
composer require terry/easysolr:dev-master

```

> ### make tests
>
> [](#make-tests)

```
cd {$vendor directory}/terry/easysolr
phpunit

```

- The test cases cannot work because of the solrzs was a private solr cloud service
- You can modify the the stub test code to adapt your solr service

> ### use EasySolr
>
> [](#use-easysolr)

- instantiated EasySolr object

```
// $solrEntryPoint is the entry of solr query api, e.g. http://solr-host/solr/collection-name/
// $settings is query settings, e.g. ['wt' = 'json']
// $logLevel follow the level rules which decleared in \Psr\Log
$solr = new EasySolr($solrEntryPoint, $settings = [], $logLevel = \Psr\Log\LogLevel::WARNING);

```

- query docs

```
// the statements below equal to
// query data by http://solr-host/solr/collection-name/select?q=(wx_name:rmrbwx)&wt=json&fl=wx_name,name,title,url,posttime_date,read_num_1&start=2&rows=2&sort=read_num_1 asc
$res = $solr->query([
            'criteria' => [
                [['wx_name', 'rmrbwx']]
            ],
            'fields' => ['wx_name', 'name', 'title', 'url', 'posttime_date', 'read_num_1'],
            'limit' => 2,
            'page' => 2,
            'sort' => 'read_num_1 asc'
        ]);

// criteria support nested query, if you want to build a query like "(name1:value1) OR ((name2:value2) AND (name3:value3))"
// you should just set the value of key 'criteria' like this
[['name1', 'value1']],
  [[
      [['name2', 'value2']],
      [['name3', 'value3'], 'AND']
  ], 'OR']

```

- query a doc

```
// the statements below equals to query data by
// http://solr-host/solr/collection-name/select?q=(sn:ce949ee86c1250865120d136f54497dd)&wt=json&fl=title,sn,posttime&start=0&rows=1&sort=
$doc = $solr->queryDoc([
            'criteria' => [
                [['sn', 'ce949ee86c1250865120d136f54497dd']],
            ],
            'fields' => ['title', 'sn', 'posttime'],
        ]);

```

- aggregate

```
the statements below equals to query data by
// http://solr-host/solr/collection-name/select?q=*:*&wt=json&fl=&start=0&rows=0&sort=&facet=on&facet.limit=3&facet.field=wx_name&facet.mincount=1&facet.offset=0
$res = $solr->groupBy('wx_name', ['limit' => 3]);
// you can add more facet configs
// http://solr-host/solr/collection-name/select?q=(posttime_date:20180201)&wt=json&fl=&start=0&rows=0&sort=&facet=on&facet.limit=10&facet.mincount=10&facet.page=2&facet.field=wx_name&facet.offset=10
$res = $solr->groupBy('wx_name', [
            'limit' => 10,
            'mincount' => 10,
            'page' => 2,
        ], [
            'criteria' => [
                [['posttime_date', '20180201']]
            ]
        ]);

```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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

2332d ago

### Community

Maintainers

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

---

Top Contributors

[![debug2012](https://avatars.githubusercontent.com/u/1992251?v=4)](https://github.com/debug2012 "debug2012 (10 commits)")[![qingbo-tech](https://avatars.githubusercontent.com/u/28921728?v=4)](https://github.com/qingbo-tech "qingbo-tech (2 commits)")

---

Tags

solrsolr client

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/terry-easysolr/health.svg)

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[wheelpros/fitment-platform-api

Magento 2 (Open Source)

12.1k1.2k](/packages/wheelpros-fitment-platform-api)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

517.9M7](/packages/avalara-avataxclient)[alexacrm/dynamics-webapi-toolkit

Web API toolkit for Microsoft Dynamics 365 and Dynamics CRM

81324.1k1](/packages/alexacrm-dynamics-webapi-toolkit)[commercetools/commercetools-sdk

The official PHP SDK for the commercetools Composable Commerce APIs

19281.5k](/packages/commercetools-commercetools-sdk)

PHPackages © 2026

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