-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: Allow disable search language analyzer via env variable #13940
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: Allow disable search language analyzer via env variable #13940
Conversation
OpenAPI SnapshotProject:
|
1be5196 to
b1a8dad
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## trunk #13940 +/- ##
=======================================
Coverage 54.12% 54.13%
=======================================
Files 3203 3203
Lines 96384 96397 +13
=======================================
+ Hits 52170 52180 +10
- Misses 44214 44217 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
b1a8dad to
37e8be8
Compare
This pull request introduces a configuration option to control whether the language analyzer should be used in Elasticsearch queries, and updates the codebase to respect this setting. The main change is the addition of the
use_language_analyzerflag, which allows switching between the default language analyzer and a whitespace analyzer for search queries. The PR also ensures this configuration is properly passed through dependency injection, and adds tests to verify the new behavior.Configuration and Dependency Injection:
use_language_analyzertoConfiguration.phpandelasticsearch.yaml, with environment variable support for toggling its value. [1] [2] [3]elasticsearch.use_language_analyzerparameter as a constructor argument in service definitions, ensuring it is available in relevant classes.Query Builder Logic:
TokenQueryBuilderto accept theuseLanguageAnalyzerflag and conditionally set the analyzer tosw_whitespace_analyzerwhen the flag is disabled for both match and match phrase prefix queries. [1] [2]