fadion / Bouncy

Map Elasticsearch results to Eloquent models
MIT License
71 stars 26 forks source link

Why need new ElasticSearch() every time creating an index? #12

Closed silentred closed 8 years ago

silentred commented 9 years ago

Please check on this line. https://github.com/fadion/Bouncy/blob/l5/src/Fadion/Bouncy/BouncyTrait.php#L588

I dont understand why it is done this way instead of using an existing Client from IoC container?

fadion commented 9 years ago

It was written before registering the ElasticSearch client with the ioc and it remained like that. Except that the same method is written in 2 different classes, there's really no problem. However, if you want, you can create a pull request.

Checkout the l5 branch; it needs to be updated too.