Skip to content

Commit

Permalink
Merge pull request #50 from royopa/patch-1
Browse files Browse the repository at this point in the history
updated syntax highligthing
  • Loading branch information
Seldaek committed Jul 14, 2015
2 parents 464a71c + 3534fd9 commit 774cf60
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,23 @@ solr client.

Require the `nelmio/solarium-bundle` package in your composer.json and update your dependencies.

$ composer require nelmio/solarium-bundle
```sh
$ composer require nelmio/solarium-bundle
```

Add the NelmioSolariumBundle to your AppKernel.php

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

## Basic configuration

Expand Down Expand Up @@ -73,10 +77,10 @@ If you only have one endpoint, the ```client``` section is not necessary
## Usage

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

For more information see the [Solarium documentation](http://www.solarium-project.org/documentation/).
Expand Down Expand Up @@ -183,16 +187,16 @@ nelmio_solarium:
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):

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

or if you have configured a default client

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

## Overriding Classes
Expand Down

0 comments on commit 774cf60

Please sign in to comment.