PHPackages                             opendi/solrclient - 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. opendi/solrclient

ActiveLibrary[API Development](/categories/api)

opendi/solrclient
=================

Client for Apache Solr

1.3.0(9y ago)23.0k1[1 PRs](https://github.com/opendi/solrclient/pulls)Apache-2.0PHPPHP &gt;=5.5.9CI failing

Since Apr 11Pushed 3w ago7 watchersCompare

[ Source](https://github.com/opendi/solrclient)[ Packagist](https://packagist.org/packages/opendi/solrclient)[ Docs](https://github.com/opendi/solrclient)[ RSS](/packages/opendi-solrclient/feed)WikiDiscussions develop Synced 3w ago

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

solrclient
==========

[](#solrclient)

Classes for the busy PHP developer to work with Apache Solr.

[![Circle CI](https://camo.githubusercontent.com/ca0fb8d5e8bd13ec6d93e2f5e41c59d439aa0404b051e681a0e533d59ef48d1e/68747470733a2f2f696d672e736869656c64732e696f2f636972636c6563692f70726f6a6563742f6f70656e64692f736f6c72636c69656e742e7376673f7374796c653d666c61742d737175617265)](https://circleci.com/gh/opendi/solrclient)![Packagist](https://camo.githubusercontent.com/1d3bb67fa9f371af898cc2d5faac55f2ecfb667aaf38eef7d53ac620a544bf29/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f70656e64692f736f6c72636c69656e742e7376673f7374796c653d666c61742d737175617265)[![License](https://camo.githubusercontent.com/5be4405d76b62de131d1cc6e2f0fa850342648a8f382116dbc986bf405825a52/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6f70656e64692f736f6c72636c69656e742e737667)](https://github.com/opendi/solrclient/blob/develop/LICENSE)

Requirements
------------

[](#requirements)

This package requires at least PHP 5.5.9.

Construction
------------

[](#construction)

First, you must construct a Guzzle HTTP client and set the `base_uri` option to the Solr endpoint you wish to work with. Then use it to create a Solr Client.

```
use Opendi\Solr\Client\Client;

$guzzle = new \GuzzleHttp\Client([
    'base_uri' => "http://localhost:8983/solr/"
]);

$client = new Client($guzzle);
```

It's also possible to pass some default request options, such as headers and timeouts to the Guzzle client.

```
use Opendi\Solr\Client\Client;

$guzzle = new \GuzzleHttp\Client([
    'base_uri' => "http://localhost:8983/solr/",
    'defaults' => [
        'timeout' => 10
    ]
]);

$solr = new Client($guzzle);
```

See [Guzzle documentation](http://docs.guzzlephp.org/) for all options.

There is a helper `factory($url, $defaults)` static method which does the same as above.

```
use Opendi\Solr\Client\Client;

$solr = Client::factory('http://localhost:8983/solr/', [
    'timeout' => 10
]);
```

Working with cores
------------------

[](#working-with-cores)

A `core` is solar terminology for a collection of records. To select a core, use the `core($name)` method on the Solr Client.

```
$core = $client->core('places');

// Perform a select query
$select = Solr::select()->search('name:Franz');
$client->core('places')->select($select);

// Perform an update query
$update = Solr::update()->body('{}');
$client->core('places')->update($update);
```

The Core object offers some helper methods:

```
// Returns core status
$client->core('places')->status();

// Returns number of documents in a core
$client->core('places')->count();

// Deletes all records in the core
$client->core('places')->deleteAll();

// Deletes records matching a selector
$client->core('places')->deleteByQuery('name:Opendi');

// Deletes record with the given ID
$client->core('places')->deleteByID('100');

// Checks the core is up
$client->core('places')->ping();

// Optimizes core documents
$client->core('places')->optimize();

// Commits inserted documents
$client->core('places')->commit();
```

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance62

Regular maintenance activity

Popularity21

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 77.6% 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 ~69 days

Recently: every ~149 days

Total

17

Last Release

3352d ago

Major Versions

0.5.0 → 1.0.0-beta12015-07-14

PHP version history (2 changes)0.1PHP &gt;=5.4.0

1.2.0PHP &gt;=5.5.9

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/482138?v=4)[Ivan Habunek](/maintainers/ihabunek)[@ihabunek](https://github.com/ihabunek)

![](https://avatars.githubusercontent.com/u/873786?v=4)[Christian Grobmeier](/maintainers/grobmeier)[@grobmeier](https://github.com/grobmeier)

---

Top Contributors

[![ihabunek](https://avatars.githubusercontent.com/u/482138?v=4)](https://github.com/ihabunek "ihabunek (121 commits)")[![grobmeier](https://avatars.githubusercontent.com/u/873786?v=4)](https://github.com/grobmeier "grobmeier (33 commits)")[![mfeldheim](https://avatars.githubusercontent.com/u/878755?v=4)](https://github.com/mfeldheim "mfeldheim (2 commits)")

---

Tags

solr

### Embed Badge

![Health badge](/badges/opendi-solrclient/health.svg)

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M19.9k](/packages/laravel-framework)[sylius/sylius

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

8.5k5.9M733](/packages/sylius-sylius)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

21866.0M1.7k](/packages/drupal-core)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M418](/packages/drupal-core-recommended)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M568](/packages/shopware-core)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)

PHPackages © 2026

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