This release is for compatibility with both Laravel 10 and 11, and marks a version bump to 4.5.0.
New features
1. Bypass field map validation for queries that require keyword mapping
Keyword type queries are checked by default and will select the keyword sub-mapping if it is found; however, this invokes an extra query to check the mapping first.
You can now disable this by setting options.bypass_map_validation = true
'elasticsearch' => [
......
'options' => [
'bypass_map_validation' => env('ES_OPT_BYPASS_MAP_VALIDATION', false),
.....
],
.....
],
2. Adjustable chunk size for bulk insert (default 1000)
When performing bulk inserts, the default is 1000 at a time.
You can now adjust this by setting options.insert_chunk_size
to your desired amount.
'elasticsearch' => [
......
'options' => [
'insert_chunk_size' => env('ES_OPT_INSERT_CHUNK_SIZE', 1000),
.....
],
.....
],
Updated connection config
'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' => [
'bypass_map_validation' => env('ES_OPT_BYPASS_MAP_VALIDATION', false),
'insert_chunk_size' => env('ES_OPT_INSERT_CHUNK_SIZE', 1000),
'logging' => env('ES_OPT_LOGGING', false),
'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),
],
'error_log_index' => env('ES_ERROR_INDEX', false),
],
3. Removed redundant methods, new exceptions and code clean by @use-the-fork via #48
Full Changelog: v4.4.1...v4.5.0