ruflin/Elastica — Issue #132: Should integrate nicely with Heroku ElasticSearch addon…
Author: nz
Created: 2012-02-13 17:20:29+00:00
State: open

Hi @ruflin,

The ElasticSearch addon now in alpha at Heroku provides the `ELASTICSEARCH_URL` environment variable to specify where the index lives. Is there a way to facilitate integration for Heroku apps that use this value?

I notice that the initializer for `Elastica_Client` can accept an associative array to configure the server endpoint(s). Perhaps it might help to accept a URL as a single unparsed string instead?

The simplest syntax I can think of:

```php
$client = new Elastica_Client(getenv('ELASTICSEARCH_URL'))
```

Though this is pretty reasonable too…

```php
$client = new Elastica_Client(array('server' => getenv('ELASTICSEARCH_URL')))
```

Just thinking out loud here. What do you think?