Download the PHP package novius/laravel-scout-elasticsearch-driver without Composer
On this page you can find all versions of the php package novius/laravel-scout-elasticsearch-driver. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-scout-elasticsearch-driver
Scout Elasticsearch Driver
This package is an adaptation of babenkoivan/scout-elasticsearch-driver to get working with Elasticsearch >= 7.0.0
This package version was created to be compatible with Elasticsearch "Removal of mapping types" introduced in Elasticsearch >= 7.0.0
Features added
-
Model's type is now saved in
type
field by default according to Elasticsearch recommendations - After a model search, an attribute
_score
will be hydrated on your result Model.
Example :
- Logs : you can now use Laravel loggers to log ElasticSearch's requests
To enable logs you have to set SCOUT_ELASTIC_LOG_ENABLED
to true
and specify which log's channel(s) to use.
Example :
config/logging.php
elastic:reindex
a new command to build and populate a new index with 0 downtime ;
config/scout_elastic.php
Features deleted from original package
elastic:update-mapping
command ;elastic:migrate
command ;elastic:update
command ;- Mapping of models : replaced by
getDefaultMapping()
of index configurator ; - Single indexer ;
Requirements
- PHP >= 7.4
- Laravel Framework >= 7.25
- Elasticsearch >= 7.0.0
For Laravel > 6 and < 7.25 you can install 2.x version.
Installation
Configuration
To configure the package you need to publish settings first:
Then, set the driver setting to elastic
in the config/scout.php
file and configure the driver itself in the config/scout_elastic.php
file.
The available options are:
Option | Description |
---|---|
client | A setting hash to build Elasticsearch client. More information you can find here. By default the host is set to localhost:9200 . |
document_refresh | This option controls when updated documents appear in the search results. Can be set to 'true' , 'false' , 'wait_for' or null . More details about this option you can find here. By default set to null . |
Note, that if you use the bulk document indexing you'll probably want to change the chunk size, you can do that in the config/scout.php
file.
Usage
Please read the original package documentation.
Lint
Run php-cs with:
Contributing
Contributions are welcome! Leave an issue on Github, or create a Pull Request.
Licence
This package is under MIT Licence.
All versions of laravel-scout-elasticsearch-driver with dependencies
elasticsearch/elasticsearch Version ^7.17
laravel/framework Version ^10.0
laravel/scout Version ^10.0