Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] change extend method name to elasticsearch #276

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Aryalav
Copy link

@Aryalav Aryalav commented May 11, 2024

This PR changes the extended name to simply "elasticsearch". So, in the environment, instead of:
SCOUT_DRIVER=Matchish\ScoutElasticSearch\Engines\ElasticSearchEngine
we can simply write:
SCOUT_DRIVER=elasticsearch

@hkulekci
Copy link
Contributor

hkulekci commented May 20, 2024

Hello @Aryalav, thank you for your contribution. Will it also work with class names to avoid backwards compatibility issues?

@matchish
Copy link
Owner

matchish commented May 20, 2024

Also other drivers could have the same name elasticsearch. And I agree with @hkulekci that it's better to keep backward compatibility. as you can see now the tests are failed.
To summarise I'm ok if we could have shorter name as alternative but class name should work as well. And the string should be less generic to differentiate from other drivers

@matchish
Copy link
Owner

maybe an option is a config parameter, to specify alternative driver name

@Aryalav
Copy link
Author

Aryalav commented May 20, 2024

maybe an option is a config parameter, to specify alternative driver name

Thanks for your reply.
Sounds fair; I will add this as a key in the config.

@Aryalav Aryalav marked this pull request as draft May 20, 2024 14:38
@Aryalav Aryalav marked this pull request as ready for review May 22, 2024 18:44
@codecov-commenter
Copy link

codecov-commenter commented May 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.99%. Comparing base (9b675df) to head (be7f9e1).
Report is 9 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #276      +/-   ##
============================================
- Coverage     96.08%   95.99%   -0.10%     
  Complexity      194      194              
============================================
  Files            36       36              
  Lines           639      624      -15     
============================================
- Hits            614      599      -15     
  Misses           25       25              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

config/elasticsearch.php Outdated Show resolved Hide resolved
@@ -23,7 +23,7 @@ public function boot(): void
{
$this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'scout');

$this->app->make(EngineManager::class)->extend(config('elasticsearch.extended_as'), function () {
$this->app->make(EngineManager::class)->extend(config('elasticsearch.driver_name',ElasticSearchEngine::class), function () {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space needed 'elasticsearch.driver_name', ElasticSearchEngine::class

Copy link

sonarcloud bot commented Nov 14, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants