Download the PHP package mabadir/elastic-laravel without Composer
On this page you can find all versions of the php package mabadir/elastic-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mabadir/elastic-laravel
More information about mabadir/elastic-laravel
Files in mabadir/elastic-laravel
Package elastic-laravel
Short Description Elastic Search Indexer for Laravel 5
License MIT
Homepage https://github.com/mabadir/elastic-laravel
Informations about the package elastic-laravel
elastic-laravel
Elastic Search Indexer for Laravel 5.
Structure
If any of the following are applicable to your project, then the directory structure should follow industry best practises by being named the following.
Install
Via Composer
Usage
Add the ElasticLaravelServiceProvider
to your config/app.php
.
Publish the elastic.php
to your configuration.
Add the ElasticEloquent trait to your Eloquent model to have it indexed.
For searching the index, you can run search with different approaches. The first step is to add the Facade to your config/app.php
:
-
Simple term search:
- Simple term search on specific model type:
This will search the Elastic Search index for the simple term with type=users
.
- Search index on specific parameter:
This will search the complete Search Index for the parameter name with value First Name
- Search index on specific parameter and specific model type:
This will search the Search Index for the parameter name with value First Name
on type=users
.
- Advanced Search:
This exposes the complete Elastic Search powerful query DSL interface, this will accept any acceptable Elastic Search DSL query.
- Advanced Search:
This will search the index using the advanced query for type=users
.
For the different functions, the class name can be used instead of the object itself, the object or the class should be extending Eloquent Model class \Illuminate\Database\Eloquent\Model
. For example:
ElasticSearch Indexing Console Command
By default the package provides a default index initialization command:
The default command will initialize the index with very basic settings. If it is required to initialize the index with more advanced settings and custom mappings: Create a new Console Command in your application:
Import the IndexInitializationTrait
class, and overload the $params
attribute:
For more details on the configuration parameters, check the official ElasticSearch documentation.
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
Contributing
Please see CONDUCT for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Mina Abadir
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of elastic-laravel with dependencies
elasticsearch/elasticsearch Version ^5.1
illuminate/support Version ~5.1