Package Data | |
---|---|
Maintainer Username: | shift31 |
Maintainer Contact: | code@shift31.com (Shift 31 Consulting) |
Package Create Date: | 2013-10-27 |
Package Last Update: | 2017-08-24 |
Home Page: | |
Language: | PHP |
License: | Unknown |
Last Refreshed: | 2024-11-29 15:10:53 |
Package Statistics | |
---|---|
Total Downloads: | 365,853 |
Monthly Downloads: | 281 |
Daily Downloads: | 6 |
Total Stars: | 195 |
Total Watchers: | 12 |
Total Forks: | 40 |
Total Open Issues: | 3 |
This is a Laravel (4.2) Service Provider for the official Elasticsearch low-level client.
Since there are breaking changes in Elasticsearch versions, your version of Elasticsearch must match the version of this library, which matches the version of the Elasticsearch low-level client.
|Shift31/laravel-elasticsearch| Elasticsearch | Laravel | | :---: | :---: | :---: | | 0.4| <= 0.90.* | 4.2 | | 1.0, 2.0| >= 1.0 | 4.x, 5.x | |4.0| <= 0.90.* | 4.2| |4.1| >= 1.0 <= 2.0 | 4.2| |4.2| >= 2.0 <= 5.0| 4.2| |4.5| >= 5.0| 4.2| |5.0| <= 0.90.* | 5.x| |5.1| >= 1.0 <= 2.0 | 5.x| |5.2| >= 2.0 <= 5.0| 5.x| |5.5| >= 5.0| 5.x|
Attention: Until we launch new versions please keep using old stable versions (which are created as a branch) and don't use dev-master branch!
Run composer require shift31/laravel-elasticsearch:~4.5.0
Publish config file
Laravel artisan command
$ php artisan config:publish shift31/laravel-elasticsearch
You can always read config parameters with:
\Config::get('shift31::elasticsearch');
Note: The keys of this array should be named according the parameters supported by Elasticsearch\ClientBuilder.
In the 'providers'
array in app/config/app.php, add 'Shift31\LaravelElasticsearch\ElasticsearchServiceProvider'
.
Use the Es
facade to access any method from the Elasticsearch\Client
class, for example:
$searchParams['index'] = 'your_index';
$searchParams['size'] = 50;
$searchParams['body']['query']['query_string']['query'] = 'foofield:barstring';
$result = Es::search($searchParams);
If you return an empty array in the config file, Service provider merges default config with custom config variables. For custom config file question please see this elastic search configuration page.
Default config file which is publishing by artisan command.
Please see CONTRIBUTING.md.