PHPackages                             aoepeople/solr-rest-api-client - 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. aoepeople/solr-rest-api-client

AbandonedArchivedLibrary[API Development](/categories/api)

aoepeople/solr-rest-api-client
==============================

PHP Client for the solr rest api

0.0.2(11y ago)16.4k1MITPHPPHP &gt;=5.3.3

Since May 21Pushed 11y ago34 watchersCompare

[ Source](https://github.com/AOEpeople/solr-rest-api-client)[ Packagist](https://packagist.org/packages/aoepeople/solr-rest-api-client)[ Docs](http://www.searchperience.com/)[ RSS](/packages/aoepeople-solr-rest-api-client/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (6)Versions (3)Used By (0)

Solr RESTApi Client
===================

[](#solr-restapi-client)

Author:Timo Schmidt &lt;&gt;Author:AOE &lt;&gt;Description:PHP Library to communicate with the RestFul API of Apache SolrHomepage:Build status:[![Build Status :target: http://travis-ci.org/timoschmidt/solr-rest-api-client](https://camo.githubusercontent.com/09a9ffac4d2482d4e3565d9a5fd0e56457dc08c7bbe8b9134bb00930bcc6ee65/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f74696d6f7363686d6964742f736f6c722d726573742d6170692d636c69656e742e706e673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/09a9ffac4d2482d4e3565d9a5fd0e56457dc08c7bbe8b9134bb00930bcc6ee65/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f74696d6f7363686d6964742f736f6c722d726573742d6170692d636c69656e742e706e673f6272616e63683d6d6173746572)Foreword
--------

[](#foreword)

With appearance of SOLR \[Managed Resources\]() feature, our intention was to implement tiny and easy to use PHP API client to communicate to SOLR REST API interface.

Solr client basics
------------------

[](#solr-client-basics)

The solr rest api client can be used to manage the following solr entities with the solr rest api:

- Synonyms
- Stopwords
- Managed Resources

Synonyms
--------

[](#synonyms)

In solr you can configure a "managed" synonym with the following entry in your schema.xml:

```

```

When you have defined a managed synonym list as described below you can see it in the list of the manged resources (e.g.: /&lt;core/collectionpath&gt;/schema/managed) and manage it with the solr rest api

The following example shows how you can used the api client to manage synonyms with a certain tag:

```
require '/vendor/autoload.php';

$factory = new \SolrRestApiClient\Common\Factory();
$repository = $factory->getSynonymRepository('localhost',8080,'solr//');

$synonymCollection = new \SolrRestApiClient\Api\Client\Domain\Synonym\SynonymCollection();

$synonym = new \SolrRestApiClient\Api\Client\Domain\Synonym\Synonym();
$synonym->setMainWord('foo');
$synonym->addWordsWithSameMeaning('bar');
$synonym->addWordsWithSameMeaning('bla');

$synonymCollection->add($synonym);

$result = $repository->addAll($synonymCollection,'mytag');
```

Stopwords
---------

[](#stopwords)

In solr you can configure a "managed" stopwords with the following entry in your schema.xml:

```

```

When you have defined a managed stopwords list as described below you can see it in the list of the manged resources (e.g.: /&lt;core/collectionpath&gt;/schema/managed) and manage it with the solr rest api

The following example shows how you can use the api client to manage stopwords with a certain tag:

```
require '/vendor/autoload.php';

$factory = new \SolrRestApiClient\Common\Factory();
$repository = $factory->getStopWordRepository('localhost',8080,'solr//');

$stopwordCollection = new \SolrRestApiClient\Api\Client\Domain\StopWord\StopWordCollection();

$stopword = new \SolrRestApiClient\Api\Client\Domain\StopWord\StopWord();
$stopword->setWord('foo');

$stopwordCollection->add($stopword);

$result = $repository->addAll($stopwordCollection, 'french');
```

In addition to addAll method some other methods exist in repository like:

- getAll;
- getByWord;
- deleteAll;
- deleteByWord;

Managed Resources
-----------------

[](#managed-resources)

Some resources in solr (e.g. synonyms and stopwords) can be managed as managed resources. To be able to read and write them you need to be able to get them from the solr server.

To manage this, you can use the ManagedResourceRepository.

The following example shows how to get all synonym resources and add a synonym collection to all of them:

```
require '/vendor/autoload.php';

$factory = new \SolrRestApiClient\Common\Factory();
$managedResourceRepository  = $factory->getManagedResourceRepository('localhost',8080,'solr//');
$resources                  = $managedResourceRepository->getAll();

$synonymRepository          = $factory->getSynonymRepository('localhost',8080,'solr//');
$synonymResources           = $resources->getSynonymResources();

foreach($synonymResources as $synonymResource) {
        $synonymRepository->setResource($synonymResource);

    $synonymCollection = new \SolrRestApiClient\Api\Client\Domain\Synonym\SynonymCollection();

    $synonym = new \SolrRestApiClient\Api\Client\Domain\Synonym\Synonym();
    $synonym->setMainWord("one");
    $synonym->addWordsWithSameMeaning("one#one");
    $synonym->addWordsWithSameMeaning("one#two");
    $synonymCollection->add($synonym);

    $synonymRepository->addAll($synonymCollection);
}
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.8% 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 ~8 days

Total

2

Last Release

4362d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5fabe34d62dfcd3a7e4d5216d0fbb905f7ab8367ca61759ef0d86f190e9e55a6?d=identicon)[timoschmidt](/maintainers/timoschmidt)

---

Top Contributors

[![timohund](https://avatars.githubusercontent.com/u/964675?v=4)](https://github.com/timohund "timohund (36 commits)")[![ndiaur](https://avatars.githubusercontent.com/u/6746099?v=4)](https://github.com/ndiaur "ndiaur (5 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/aoepeople-solr-rest-api-client/health.svg)

```
[![Health](https://phpackages.com/badges/aoepeople-solr-rest-api-client/health.svg)](https://phpackages.com/packages/aoepeople-solr-rest-api-client)
```

###  Alternatives

[rackspace/php-opencloud

PHP SDK for Rackspace/OpenStack APIs

4495.9M38](/packages/rackspace-php-opencloud)[cdaguerre/php-trello-api

Trello API v2 client

255666.7k3](/packages/cdaguerre-php-trello-api)[dchesterton/marketo-rest-api

A PHP client for the Marketo.com REST API

41844.1k1](/packages/dchesterton-marketo-rest-api)[carlosio/geckoboard

A PHP library for dealing with Geckoboard API (http://www.geckoboard.com)

40172.2k](/packages/carlosio-geckoboard)[teepluss/api

Laravel 4 Internal Request (HMVC)

7034.0k](/packages/teepluss-api)[jlinn/mandrill-api-php

A PHP client library for Mandrill's REST API

24117.4k](/packages/jlinn-mandrill-api-php)

PHPackages © 2026

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