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

[Manual backport 2.x][Feature] Expose term frequency in Painless script score context (#9081) #9517

Merged

Conversation

noCharger
Copy link
Contributor

@noCharger noCharger commented Aug 23, 2023

Add the following functions in Painless script score context:

  • termfreq
  • tf
  • totaltermfreq
  • sumtotaltermfreq

Each of these maps to a Lucene value source.

Signed-off-by: Louis Chu clingzhi@amazon.com
(cherry picked from commit 5d3633c)

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.

…nsearch-project#9081)

Add the following functions in Painless script score context:
* termfreq
* tf
* totaltermfreq
* sumtotaltermfreq

Each of these maps to a Lucene value source.

Signed-off-by: Louis Chu <clingzhi@amazon.com>
(cherry picked from commit 5d3633c)
@opensearch-trigger-bot
Copy link
Contributor

Compatibility status:

Checks if related components are compatible with change ea3c5af

Incompatible components

Incompatible components: [https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/performance-analyzer.git]

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/ml-commons.git]

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.repositories.azure.AzureBlobContainerRetriesTests.testWriteLargeBlob

@codecov
Copy link

codecov bot commented Aug 23, 2023

Codecov Report

Merging #9517 (bc5658d) into 2.x (ea3c5af) will decrease coverage by 0.13%.
The diff coverage is 15.11%.

@@             Coverage Diff              @@
##                2.x    #9517      +/-   ##
============================================
- Coverage     70.90%   70.77%   -0.13%     
+ Complexity    57658    57561      -97     
============================================
  Files          4764     4766       +2     
  Lines        272098   272175      +77     
  Branches      40111    40112       +1     
============================================
- Hits         192918   192622     -296     
- Misses        62647    62944     +297     
- Partials      16533    16609      +76     
Files Changed Coverage Δ
...earch/script/expression/ExpressionScoreScript.java 0.00% <0.00%> (ø)
...arch/script/expression/ExpressionScriptEngine.java 33.99% <ø> (ø)
...earch/example/expertscript/ExpertScriptPlugin.java 0.00% <0.00%> (ø)
...ry/functionscore/TermFrequencyFunctionFactory.java 0.00% <0.00%> (ø)
...n/java/org/opensearch/script/ScoreScriptUtils.java 1.43% <0.00%> (-0.31%) ⬇️
...nsearch/search/lookup/LeafTermFrequencyLookup.java 35.71% <35.71%> (ø)
...c/main/java/org/opensearch/script/ScoreScript.java 56.92% <50.00%> (-1.15%) ⬇️
...nsearch/painless/action/PainlessExecuteAction.java 77.58% <100.00%> (+0.29%) ⬆️
...uery/functionscore/ScriptScoreFunctionBuilder.java 85.36% <100.00%> (ø)
...x/query/functionscore/ScriptScoreQueryBuilder.java 82.27% <100.00%> (ø)

... and 459 files with indirect coverage changes

@msfroh msfroh merged commit 6d94fd2 into opensearch-project:2.x Aug 23, 2023
34 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants