v4.0.1
Laravel 10 & 11
This Release is for both Laravel 10 and 11 users, require:
"pdphilip/elasticsearch": "^4.0"
New Features
highlight()
- This package now dials into Elaticsearch's highlight feature - docswhereTimestamp()
- convenience clause to help sanitize timestamp values - docs - issue #22rawAggregation()
- similar torawSearch()
, passing in aggregation DSL queries will be processed and formatted- docs - issue #24
Upgrades
- Improved error handling with readable messages and method for full data docs
- Chunking rebuilt around Elasticseach PIT (Point in time) API docs - issue #23
- Models have a built-in method for returning a query's metadata - docs
- Connection upgrades to allow more options
- Set Verify SSL
- Set Retries
- Set ES Meta headers override
- Sorting by
_id
disabled by default. The package will now remove any clauses that include_id
sorting.
Update your databse.php to fit the new config features:
'elasticsearch' => [
'driver' => 'elasticsearch',
'auth_type' => env('ES_AUTH_TYPE', 'http'), //http or cloud
'hosts' => explode(',', env('ES_HOSTS', 'http://localhost:9200')),
'username' => env('ES_USERNAME', ''),
'password' => env('ES_PASSWORD', ''),
'cloud_id' => env('ES_CLOUD_ID', ''),
'api_id' => env('ES_API_ID', ''),
'api_key' => env('ES_API_KEY', ''),
'ssl_cert' => env('ES_SSL_CA', ''),
'ssl' => [
'cert' => env('ES_SSL_CERT', ''),
'cert_password' => env('ES_SSL_CERT_PASSWORD', ''),
'key' => env('ES_SSL_KEY', ''),
'key_password' => env('ES_SSL_KEY_PASSWORD', ''),
],
'index_prefix' => env('ES_INDEX_PREFIX', false),
'options' => [
'allow_id_sort' => env('ES_OPT_ID_SORTABLE', false),
'ssl_verification' => env('ES_OPT_VERIFY_SSL', true),
'retires' => env('ES_OPT_RETRIES', null),
'meta_header' => env('ES_OPT_META_HEADERS', true),
],
'query_log' => [
'index' => false, //Or provide a name for the logging index ex: 'laravel_query_logs'
'error_only' => true, //If false, then all queries are logged if the query_log index is set
],
],
Bug fixes
- Failed calls trigger a connection rebuild to counter cached failed connections via job queues - issue #27
- Return type error for index_prefixes to allow for null
- Allow for API key in local connection config
Full Changelog: v3.11.0...v4.0.1