laravel-elasticsearch
laravel-elasticsearch copied to clipboard
Feature/unsafe queries / Bug Fix Losing Connection
This PR aims to add a new option to allow a developer to opt into using "unsafe_queries". Essentially It's supposed to skip mapping checks and avoid doing any elastic search calls Except for when getting database info.
This is mostly needed from a performance perspective.
I also am running into a weird issue where save and saveWithOutRefresh lose their connection and as a result throw an exception. I can't replicate it in tests just in my environment that uses a Cloud connection. As a result, I added safety measures to ensure a connection existed before building the bridge.
Thanks @use-the-fork, will have a look here when I get a chance
Hey @use-the-fork , thanks for putting this one together. It's been published in v4.5.0
Just note that I changed the option name from perform_unsafe_queries to bypass_map_validation. perform_unsafe_queries may be construed as being more dangerous than it is to new users.
'elasticsearch' => [
......
'options' => [
'bypass_map_validation' => env('ES_OPT_BYPASS_MAP_VALIDATION', false),
.....
],
.....
],
@pdphilip yea that makes sence. Thanks for merging it in!