PHPackages                             msdev/solarium-bundle - 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. msdev/solarium-bundle

ActiveSymfony-bundle[API Development](/categories/api)

msdev/solarium-bundle
=====================

Integration with solarium solr client.

129PHP

Since Aug 23Pushed 4y ago1 watchersCompare

[ Source](https://github.com/sadiq810/solarium-php8-symfony53)[ Packagist](https://packagist.org/packages/msdev/solarium-bundle)[ RSS](/packages/msdev-solarium-bundle/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

NelmioSolarium Bundle
=====================

[](#nelmiosolarium-bundle)

[![Latest Version](https://camo.githubusercontent.com/65390736276bdc8d16adec7924fad143da5dd7065de6b141efa4c2f2092ca467/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6e656c6d696f2f4e656c6d696f536f6c617269756d42756e646c652e7376673f7374796c653d666c61742d737175617265)](https://github.com/nelmio/NelmioSolariumBundle/releases)[![Total Downloads](https://camo.githubusercontent.com/c702a2c04e0745b99496cee871facb0e0569be18bbc6709658b7be586f3c77c5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e656c6d696f2f736f6c617269756d2d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nelmio/solarium-bundle)

About : Upgraded for PHP-8 and Symfony 5.3
------------------------------------------

[](#about--upgraded-for-php-8-and-symfony-53)

The NelmioSolariumBundle provides integration with the [solarium](http://www.solarium-project.org)solr client.

Installation
------------

[](#installation)

Require the `msdev/solarium-bundle:dev-master` package in your composer.json and update your dependencies.

```
$ composer require msdev/solarium-bundle:dev-master
```

Add the NelmioSolariumBundle to your AppKernel.php

```
public function registerBundles()
{
    $bundles = array(
        ...
        new Nelmio\SolariumBundle\NelmioSolariumBundle(),
        ...
    );
    ...
}
```

Basic configuration
-------------------

[](#basic-configuration)

Quick-start configuration:

```
nelmio_solarium: ~
```

Gives you a Solarium\_Client service with default options (`http://localhost:8983/solr`)

```
    $client = $this->get('solarium.client');
```

Configure your endpoints in config.yml:

```
nelmio_solarium:
    endpoints:
        default:
            scheme: http
            host: localhost
            port: 8983
            path: /solr
            core: active
    clients:
        default:
            endpoints: [default]
```

If you only have one endpoint, the `client` section is not necessary

Usage
-----

[](#usage)

```
$client = $this->get('solarium.client');
$select = $client->createSelect();
$select->setQuery('foo');
$results = $client->select($select);
```

For more information see the [Solarium documentation](http://solarium.readthedocs.io/en/stable/).

Multiple clients and endpoints
------------------------------

[](#multiple-clients-and-endpoints)

```
nelmio_solarium:
    endpoints:
        default:
            host: 192.168.1.2
        another:
            host: 192.168.1.3
    clients:
        default:
            endpoints: [default]
        another:
            endpoints: [another]
```

```
    $defaultClient = $this->get('solarium.client');
    $anotherClient = $this->get('solarium.client.another');
```

You may also change `default` name with your own, but don't forget change `default_client` option if you want to get access to `solarium.client` service

```
nelmio_solarium:
    default_client: firstOne
    endpoints:
        firstOne:
            host: 192.168.1.2
        anotherOne:
            host: 192.168.1.3
    clients:
        firstOne:
            endpoints: [firstOne]
        anotherOne:
            endpoints: [anotherOne]
```

```
    $firstOneClient = $this->get('solarium.client');
    //or
    $firstOneClient = $this->get('solarium.client.firstOne');

    $anotherOneClient = $this->get('solarium.client.anotherOne');
```

Starting from Solarium 3.x you can also have multiple endpoints within the same client

```
nelmio_solarium:
    endpoints:
        default:
            host: 192.168.1.2
        another:
            host: 192.168.1.3
    # if you are using all the endpoints, the clients section is not necessary
    clients:
        default:
            endpoints: [default, another]
```

You can also set which is the default endpoint

```
nelmio_solarium:
    endpoints:
        default:
            host: 192.168.1.2
        another:
            host: 192.168.1.3
    clients:
        default:
            endpoints: [default, another]
            default_endpoint: another
```

You can combine both multiple client and endpoints too

```
nelmio_solarium:
    endpoints:
        one:
            host: 192.168.1.2
        two:
            host: 192.168.1.3
        three:
            host: 192.168.1.4
    clients:
        firstOne:
            endpoints: [one, two]
            default_endpoint: two
        secondOne:
            endpoints: [two, three]
            default_endpoint: three
```

Client registry
---------------

[](#client-registry)

You can also use the service `solarium.client_registry` to access the clients you have configured using the names you have used in the configuration (with the example above):

```
$registry = $this->get('solarium.client_registry');
$firstOne = $registry->getClient('firstOne');
$secondOne = $registry->getClient('secondOne');
```

or if you have configured a default client

```
$registry = $this->get('solarium.client_registry');
$default = $registry->getClient();
```

Plugins
-------

[](#plugins)

Solarium works with plugins. If you want to use your own plugins, you can register a plugin in the bundle configuration either with a service id or the plugin class:

```
nelmio_solarium:
    clients:
        default:
            plugins:
                test_plugin_service:
                    plugin_service: plugin _service_id
                test_plugin_classname:
                    plugin_class: Some\Plugin\TestPlugin
```

Overriding the Client class
---------------------------

[](#overriding-the-client-class)

To change the client class, you can set the client\_class option:

```
nelmio_solarium:
    clients:
        default:
            client_class: Solarium\Core\Client
```

Customizing the HTTP Adapter used by the Client
-----------------------------------------------

[](#customizing-the-http-adapter-used-by-the-client)

If you need to customize the Adapter that is used by the Client to perform HTTP requests to Solr then you can use the `adapter_service` option to specify the ID of a symfony service to be used as an adapter:

```
nelmio_solarium:
    clients:
        default:
            adapter_service: 'my.custom.adapter.service'
```

HTTP Request timeout
--------------------

[](#http-request-timeout)

If you are using the default adapter (`Curl`) and did not customize the `adapter_service` then you can use the `adapter_timeout` option to customize the timeout. Solarium uses a timeout of 5 seconds by default.

```
nelmio_solarium:
    clients:
        default:
            adapter_timeout: 10
```

License
-------

[](#license)

Released under the MIT License, see LICENSE.

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/60dc6b0ff7c86e1335a1f901584de29b8fd3130b7e80cea610f40239760b918d?d=identicon)[sadiq810](/maintainers/sadiq810)

---

Top Contributors

[![sadiq810](https://avatars.githubusercontent.com/u/10768377?v=4)](https://github.com/sadiq810 "sadiq810 (2 commits)")

### Embed Badge

![Health badge](/badges/msdev-solarium-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/msdev-solarium-bundle/health.svg)](https://phpackages.com/packages/msdev-solarium-bundle)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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