2017 © Pedro Peláez
 

symfony-bundle solarium-bundle

Integration with solarium solr client.

image

btmoda/solarium-bundle

Integration with solarium solr client.

  • Monday, March 26, 2018
  • by modanisa
  • Repository
  • 17 Watchers
  • 0 Stars
  • 514 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 56 Forks
  • 0 Open issues
  • 17 Versions
  • 37 % Grown

The README.md

NelmioSolarium Bundle

Latest Version Total Downloads, (*1)

About

The NelmioSolariumBundle provides integration with the solarium solr client., (*2)

Installation

Require the nelmio/solarium-bundle package in your composer.json and update your dependencies., (*3)

$ composer require nelmio/solarium-bundle

Add the NelmioSolariumBundle to your AppKernel.php, (*4)

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

Basic configuration

Quick-start configuration:, (*5)

nelmio_solarium: ~

Gives you a Solarium_Client service with default options (http://localhost:8983/solr), (*6)

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

Configure your endpoints in config.yml:, (*7)

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

If you only have one endpoint, the client section is not necessary, (*8)

Usage

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

For more information see the Solarium documentation., (*9)

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, (*10)

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, (*11)

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 wich is the default endpoint, (*12)

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, (*13)

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

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):, (*14)

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

or if you have configured a default client, (*15)

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

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:, (*16)

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

Overriding Classes

To change the adapter or client classes, you can set the client_class and adapter_class options:, (*17)

nelmio_solarium:
    clients:
        default:
            client_class: Solarium\Core\Client
            adapter_class: Solarium\Core\Client\Adapter\Http

License

Released under the MIT License, see LICENSE., (*18)

The Versions

26/03 2018

dev-master

9999999-dev

Integration with solarium solr client.

  Sources   Download

MIT

The Requires

 

The Development Requires

search solr solarium

26/03 2018

4.0.1

4.0.1.0

Integration with solarium solr client.

  Sources   Download

MIT

The Requires

 

The Development Requires

search solr solarium

26/03 2018

v4.0.0

4.0.0.0

Integration with solarium solr client.

  Sources   Download

MIT

The Requires

 

The Development Requires

search solr solarium

12/01 2018

v3.0.0-beta

3.0.0.0-beta

Integration with solarium solr client.

  Sources   Download

MIT

The Requires

 

The Development Requires

search solr solarium

08/08 2017

v2.4.0

2.4.0.0

Integration with solarium solr client.

  Sources   Download

MIT

The Requires

 

search solr solarium

04/12 2016

v2.3.0

2.3.0.0

Integration with solarium solr client.

  Sources   Download

MIT

The Requires

 

search solr solarium

29/03 2016

v2.2.1

2.2.1.0

Integration with solarium solr client.

  Sources   Download

MIT

The Requires

 

search solr solarium

21/07 2015

v2.2.0

2.2.0.0

Integration with solarium solr client.

  Sources   Download

MIT

The Requires

 

search solr solarium

21/10 2014

v2.1.0

2.1.0.0

Integration with solarium solr client.

  Sources   Download

MIT

The Requires

 

search solr solarium

26/06 2013

v2.0.4

2.0.4.0

Integration with solarium solr client.

  Sources   Download

MIT

The Requires

 

search solr solarium

08/05 2013

v2.0.3

2.0.3.0

Integration with solarium solr client.

  Sources   Download

MIT

The Requires

 

search solr solarium

03/05 2013

v2.0.2

2.0.2.0

Integration with solarium solr client.

  Sources   Download

MIT

The Requires

 

search solr solarium

07/04 2013

v2.0.1

2.0.1.0

Integration with solarium solr client.

  Sources   Download

MIT

The Requires

 

search solr solarium

27/03 2013

v2.0.0

2.0.0.0

Integration with solarium solr client.

  Sources   Download

MIT

The Requires

 

search solr solarium

07/01 2013

1.x-dev

1.9999999.9999999.9999999-dev

Integration with solarium solr client.

  Sources   Download

MIT

The Requires

 

The Development Requires

search solr solarium

07/01 2013

v1.1.0

1.1.0.0

Integration with solarium solr client.

  Sources   Download

MIT

The Requires

 

The Development Requires

search solr solarium

31/07 2012

v1.0.0

1.0.0.0

Integration with solarium solr client.

  Sources   Download

MIT

The Requires

 

The Development Requires

search solr solarium