Package Data | |
---|---|
Maintainer Username: | Spoowy |
Maintainer Contact: | erwin.flaming@gmail.com (Erwin Flaming) |
Package Create Date: | 2014-05-21 |
Package Last Update: | 2020-01-10 |
Language: | PHP |
License: | Unknown |
Last Refreshed: | 2024-11-19 03:03:33 |
Package Statistics | |
---|---|
Total Downloads: | 72 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 11 |
Total Watchers: | 4 |
Total Forks: | 1 |
Total Open Issues: | 0 |
Powerful Laravel API using the official PHP client for ElasticSearch
To install the API as a Composer package to be used with Laravel 4, simply add this to your composer.json:
"require": {
"elasticsearch/elasticsearch": "~1.0",
"spoowy/elasticsearch": "dev-master"
}
..and run composer update
(Having any problems with that? Try php artisan dump-autoload
and then composer update
again). Once it's installed, you can register the service provider in app/config/app.php
in the providers
array:
'providers' => array(
//...
'Spoowy\Elasticsearch\ElasticsearchServiceProvider',
)
Then create the config file app/config/elasticsearch.php
. Remember, this is an example with default values.
<?php
use Monolog\Logger;
return array(
'hosts' => array('localhost:9200'),
'logPath' => storage_path() . '/logs/elasticsearch-' . php_sapi_name() . '.log',
'logLevel' => Logger::INFO
);
Now, you can access the ElasticSearch API simply by: ElasticSearch::
, e.g. ElasticSearch::get($params)
More detailed information about using this API is sure to come.