dev-master
9999999-devElasticsearch driver for Laravel Scout
MIT
The Requires
The Development Requires
by Giang Thai Cuong
laravel elasticsearch scout
Wallogit.com
2017 © Pedro Peláez
Elasticsearch driver for Laravel Scout
This package provides a Elasticsearch driver for Laravel Scout., (*1)
First, install Laravel Scout Elasticsearch via the Composer package manager:, (*2)
composer require gtk/laravel-scout-elasticsearch
When using the Elasticsearch driver, you should configure your Elasticsearch hosts in your config/scout.php configuration file., (*3)
'elasticsearch' => [
'hosts' => [
env('ELASTICSEARCH_HOST', 'http://localhost:9200'),
],
],
Default usage can be found on the Laravel Scout documentation., (*4)
You may begin searching a model using the search method. The search method accepts a single string that will be used to search your models. You should then chain the get method onto the search query to retrieve the Eloquent models that match the given search query:, (*5)
$orders = App\Order::search('Star Trek')->get();
In addition, the search method accepts an array that will be used as an Elasticsearch raw query to perform an advanced search:, (*6)
$orders = App\Order::search([
'query' => [
'query_string' => [
'query' => 'Star Trek',
],
],
])->get();
You can check Elastic document for more information., (*7)
Laravel Scout Elasticsearch is open-sourced software licensed under the MIT license., (*8)
Elasticsearch driver for Laravel Scout
MIT
laravel elasticsearch scout