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

Reworked feature flag usage for Hybrid search feature #246

Conversation

martin-gaievski
Copy link
Member

@martin-gaievski martin-gaievski commented Aug 8, 2023

Description

Reworked feature flag to a plugin setting. Previous approach is failing with below error when feature is set in opensearch.yml, which supposed to be the main way of enabling hybrid search for customers:

org.opensearch.common.settings.SettingsException: unknown setting [neural_search_hybrid_search_enabled] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
        at org.opensearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:606) ~[opensearch-3.0.0.jar:3.0.0]
        at org.opensearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:547) ~[opensearch-3.0.0.jar:3.0.0]
        at org.opensearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:517) ~[opensearch-3.0.0.jar:3.0.0]
        at org.opensearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:487) ~[opensearch-3.0.0.jar:3.0.0]
        at org.opensearch.common.settings.SettingsModule.<init>(SettingsModule.java:179) ~[opensearch-3.0.0.jar:3.0.0]
        at org.opensearch.node.Node.<init>(Node.java:555) ~[opensearch-3.0.0.jar:3.0.0]
        at org.opensearch.node.Node.<init>(Node.java:388) ~[opensearch-3.0.0.jar:3.0.0]
        at org.opensearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:242) ~[opensearch-3.0.0.jar:3.0.0]
        at org.opensearch.bootstrap.Bootstrap.setup(Bootstrap.java:242) ~[opensearch-3.0.0.jar:3.0.0]
        at org.opensearch.bootstrap.Bootstrap.init(Bootstrap.java:404) [opensearch-3.0.0.jar:3.0.0]
        at org.opensearch.bootstrap.OpenSearch.init(OpenSearch.java:180) [opensearch-3.0.0.jar:3.0.0]
        at org.opensearch.bootstrap.OpenSearch.execute(OpenSearch.java:171) [opensearch-3.0.0.jar:3.0.0]
        at org.opensearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:104) [opensearch-3.0.0.jar:3.0.0]
        at org.opensearch.cli.Command.mainWithoutErrorHandling(Command.java:138) [opensearch-cli-3.0.0.jar:3.0.0]
        at org.opensearch.cli.Command.main(Command.java:101) [opensearch-cli-3.0.0.jar:3.0.0]
        at org.opensearch.bootstrap.OpenSearch.main(OpenSearch.java:137) [opensearch-3.0.0.jar:3.0.0]
        at org.opensearch.bootstrap.OpenSearch.main(OpenSearch.java:103) [opensearch-3.0.0.jar:3.0.0]

Added more logging statements for easier debugging.

Issues Resolved

#123

Check List

  • All tests pass
  • Commits are signed as per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@martin-gaievski martin-gaievski added skip-changelog backport 2.x Label will add auto workflow to backport PR to 2.x branch labels Aug 8, 2023
systemProperty('neural_search_hybrid_search_enabled', 'true')
// search pipelines
systemProperty('opensearch.experimental.feature.search_pipeline.enabled', 'true')
systemProperty('plugins.ml_commons.hybrid_search_enabled', 'true')
Copy link
Member Author

Choose a reason for hiding this comment

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

we need this to have hybrid search always enabled in testing, otherwise we need to set flag explicitly every time

/**
* Abstracts combination of scores based on arithmetic mean method
*/
@ToString(onlyExplicitlyIncluded = true)
Copy link
Member Author

Choose a reason for hiding this comment

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

adding toString to have nicer info in the log, same for all other similar toString annotations

@codecov
Copy link

codecov bot commented Aug 8, 2023

Codecov Report

Merging #246 (dc1dd60) into main (b9c86a8) will increase coverage by 0.05%.
The diff coverage is 93.33%.

@@             Coverage Diff              @@
##               main     #246      +/-   ##
============================================
+ Coverage     86.23%   86.29%   +0.05%     
- Complexity      337      340       +3     
============================================
  Files            28       29       +1     
  Lines           981      992      +11     
  Branches        153      153              
============================================
+ Hits            846      856      +10     
- Misses           69       70       +1     
  Partials         66       66              
Files Changed Coverage Δ
...ation/ArithmeticMeanScoreCombinationTechnique.java 89.47% <ø> (ø)
...nation/GeometricMeanScoreCombinationTechnique.java 94.11% <ø> (ø)
...ination/HarmonicMeanScoreCombinationTechnique.java 94.11% <ø> (ø)
...r/normalization/L2ScoreNormalizationTechnique.java 83.33% <ø> (ø)
...rmalization/MinMaxScoreNormalizationTechnique.java 84.61% <ø> (ø)
...g/opensearch/neuralsearch/plugin/NeuralSearch.java 77.77% <80.00%> (-3.48%) ⬇️
...neuralsearch/processor/NormalizationProcessor.java 83.87% <100.00%> (+0.53%) ⬆️
...arch/processor/NormalizationProcessorWorkflow.java 88.00% <100.00%> (+3.00%) ⬆️
...ocessor/factory/NormalizationProcessorFactory.java 100.00% <100.00%> (ø)
...ch/neuralsearch/settings/NeuralSearchSettings.java 100.00% <100.00%> (ø)

@martin-gaievski martin-gaievski merged commit 5819df6 into opensearch-project:main Aug 8, 2023
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-246-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 5819df61c6ce7d155463f8fcc0ffb4fd4ac3080d
# Push it to GitHub
git push --set-upstream origin backport/backport-246-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-246-to-2.x.

martin-gaievski added a commit that referenced this pull request Aug 9, 2023
Signed-off-by: Martin Gaievski <[email protected]>
(cherry picked from commit 5819df6)
martin-gaievski added a commit to martin-gaievski/neural-search that referenced this pull request Aug 25, 2023
Signed-off-by: Martin Gaievski <[email protected]>
(cherry picked from commit 5819df6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Label will add auto workflow to backport PR to 2.x branch skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants