-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add a new configuration setting synonym_analyzer
for synonym_graph
and synonym
.
#16488
base: main
Are you sure you want to change the base?
Add a new configuration setting synonym_analyzer
for synonym_graph
and synonym
.
#16488
Conversation
❌ Gradle check result for fb66d0f: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
try { | ||
this.analysisModule = new AnalysisModule(environment, | ||
List.of(this)); | ||
} catch (IOException e) { | ||
throw new RuntimeException(e); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little concerned with this approach of creating a new AnalysisModule
with its own AnalysisRegistry
.
If you define a custom analyzer, are you able to reference it from the synonym_analyzer
parameter? I could be mistaken, but I think this module's registry only knows the built-in analyzers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing that we could do is add a default method getTokenFilters(AnalysisModule)
to the AnalysisPlugin
interface that calls the existing getTokenFilters()
. Then we could override the new method in CommonAnalysisModulePlugin
. You'd also need to call the new method from setupTokenFilters
.
It does mean that we would pass a reference to the partially-constructed AnalysisModule
to getTokenFilters
. As long as a consumer only holds onto the reference and doesn't try doing anything with it right away, it should be okay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @msfroh,
-
With creation of new
AnalysisModule
, I was able to reference it from thesynonym_analyzer
parameter, also in my test not only the built-in analyzers but custom analyzer also worked [BUG] Token Filter Order: word_delimiter_graph and synonym_graph #16263 (comment). -
I agree with your suggestion we can re-use the
AnalysisModule
and dont have to instantiate a new one. In the new commit I have updated theAnalysisPlugin
section wheregetTokenFilters
takesAnalysisModule
as input. I have also updated theCommonAnalysisModulePlugin
andsetupTokenFilters
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I will revert the changes made to buildSrc/src/main/java/org/opensearch/gradle/testclusters/OpenSearchNode.java
, I was trying to test by adding config/hunspell/en_US/en-US.aff
to config folder before startup (./gradlew run -PnumNodes=3
) but OpenSearchNode.java
does not copy the folder files, so was experimenting few things with OpenSearchNode.java
I will open an issue separately for this topic.
fb66d0f
to
550756f
Compare
❌ Gradle check result for 550756f: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
550756f
to
7a5c00e
Compare
❌ Gradle check result for 7a5c00e: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
7a5c00e
to
17737cf
Compare
❌ Gradle check result for 17737cf: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Prudhvi Godithi <pgodithi@amazon.com>
17737cf
to
0332408
Compare
❌ Gradle check result for 0332408: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
458ce70
to
6feda4b
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16488 +/- ##
============================================
- Coverage 72.00% 71.97% -0.04%
+ Complexity 65038 65006 -32
============================================
Files 5313 5313
Lines 303454 303483 +29
Branches 43910 43913 +3
============================================
- Hits 218510 218427 -83
- Misses 67040 67131 +91
- Partials 17904 17925 +21 ☔ View full report in Codecov by Sentry. |
Hey @msfroh added tests similar to those described in the actual issue involving the |
Signed-off-by: Prudhvi Godithi <pgodithi@amazon.com>
6feda4b
to
db57995
Compare
Description
Coming from #16263 (comment) this PR is not final and still need some discussion.
Related Issues
Part of #16263 and #16530.
Check List
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.