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

Add Support for Alternate Legacy MULTIMATCH syntax #1102

Conversation

forestmvey
Copy link
Collaborator

Description

Add support for alternative syntax of MULTI_MATCH relevance search functions. Legacy engine supports parameter keys as quoted, or unquoted values for both required and optional arguments. This syntax has been ported over to all relevance functions in the V2 engine.

Example Queries

SELECT * FROM stackexchange_beer WHERE MULTI_MATCH('query'='cicerone', 'fields'='Tags');
SELECT * FROM stackexchange_beer WHERE MULTIMATCH('query'='cicerone', 'fields'='Tags');
SELECT * FROM stackexchange_beer WHERE MULTIMATCHQUERY('query'='cicerone', fields='Tags');
SELECT * FROM stackexchange_beer WHERE MULTIMATCHQUERY(query='cicerone', 'fields'=['Title,Tags^2.0']);

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed 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.

@forestmvey forestmvey requested a review from a team as a code owner November 24, 2022 17:13
@codecov-commenter
Copy link

codecov-commenter commented Nov 24, 2022

Codecov Report

Merging #1102 (523f974) into 2.x (d4d289c) will decrease coverage by 2.48%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##                2.x    #1102      +/-   ##
============================================
- Coverage     98.28%   95.79%   -2.49%     
- Complexity     3454     3474      +20     
============================================
  Files           345      357      +12     
  Lines          8588     9333     +745     
  Branches        547      675     +128     
============================================
+ Hits           8441     8941     +500     
- Misses          142      334     +192     
- Partials          5       58      +53     
Flag Coverage Δ
query-workbench 62.76% <ø> (?)
sql-engine 98.30% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...g/opensearch/sql/executor/execution/QueryPlan.java 100.00% <ø> (ø)
...arch/storage/script/filter/FilterQueryBuilder.java 100.00% <ø> (ø)
.../org/opensearch/sql/executor/ExecutionContext.java 100.00% <100.00%> (ø)
...java/org/opensearch/sql/executor/QueryManager.java 100.00% <100.00%> (ø)
...java/org/opensearch/sql/executor/QueryService.java 100.00% <100.00%> (ø)
...rch/sql/executor/execution/StreamingQueryPlan.java 100.00% <100.00%> (ø)
...ecutor/streaming/MicroBatchStreamingExecution.java 100.00% <100.00%> (ø)
...h/sql/expression/function/BuiltinFunctionName.java 100.00% <100.00%> (ø)
...h/sql/expression/function/OpenSearchFunctions.java 100.00% <100.00%> (ø)
.../opensearch/sql/planner/physical/PhysicalPlan.java 100.00% <100.00%> (ø)
... and 13 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@penghuo
Copy link
Collaborator

penghuo commented Nov 28, 2022

please helping update doc

@forestmvey forestmvey force-pushed the integ-add-alternate-multi-match-syntax branch from 523f974 to bf863a2 Compare December 6, 2022 16:07
Copy link
Collaborator

@dai-chen dai-chen left a comment

Choose a reason for hiding this comment

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

Thanks for the changes!

@dai-chen dai-chen merged commit b76a178 into opensearch-project:2.x Dec 6, 2022
@dai-chen dai-chen added the enhancement New feature or request label Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants