-
Notifications
You must be signed in to change notification settings - Fork 0
Add Match_query And Matchquery As Alternate Syntax for Match Function #163
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 Match_query And Matchquery As Alternate Syntax for Match Function #163
Conversation
Signed-off-by: GabeFernandez310 <[email protected]>
Signed-off-by: GabeFernandez310 <[email protected]>
Signed-off-by: GabeFernandez310 <[email protected]>
Signed-off-by: GabeFernandez310 <[email protected]>
Codecov Report
@@ Coverage Diff @@
## integ-add-legacy-syntax-for-match-function #163 +/- ##
================================================================================
- Coverage 98.27% 95.71% -2.57%
Complexity 3351 3351
================================================================================
Files 327 337 +10
Lines 8457 9117 +660
Branches 553 672 +119
================================================================================
+ Hits 8311 8726 +415
- Misses 142 334 +192
- Partials 4 57 +53
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
@GabeFernandez310 can you add an example for new syntax please? This will help the verifier. |
...src/test/java/org/opensearch/sql/opensearch/storage/script/filter/lucene/MatchQueryTest.java
Outdated
Show resolved
Hide resolved
docs/user/dql/functions.rst
Outdated
|
|
||
| ``match(field_expression, query_expression[, option=<option_value>]*)`` | ||
|
|
||
| The match function maps to the match query used in search engine, to return the documents that match a provided text, number, date or boolean value with a given field. This is alternate syntax for the `match`_ function. Available parameters include: |
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.
Please mention that this was added for backwards compatibility. See the match_phrase section:
https://github.com/Bit-Quill/opensearch-project-sql/blob/726ddbd006cfbb9c7e9f19231e5706f48de5e6ee/docs/user/dql/functions.rst#match-phrase
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.
Same comment here as above for matchquery
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.
just add a sentence like:
For backward compatibility, matchphrase is also supported and mapped to match_phrase query as well.
but using matchquery and match_query
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.
Fixed in cbccd33
MaxKsyunz
left a comment
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.
Please make sure SQL Java CI workflow passes.
Looks to be failing on checkstyle.
Signed-off-by: GabeFernandez310 <[email protected]>
Yury-Fridlyand
left a comment
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.
Can you add an IT which runs match_query, match and matchquery and compares results?
Something like:
var result1 = executeQuery(...);
var result2 = executeQuery(...);
assertTrue(result1.similar(result2));
...src/test/java/org/opensearch/sql/opensearch/storage/script/filter/lucene/MatchQueryTest.java
Outdated
Show resolved
Hide resolved
...src/test/java/org/opensearch/sql/opensearch/storage/script/filter/lucene/MatchQueryTest.java
Show resolved
Hide resolved
Signed-off-by: GabeFernandez310 <[email protected]>
Signed-off-by: GabeFernandez310 <[email protected]>
Remove usage of deprecated BaseNodeRequest Signed-off-by: Vijayan Balasubramanian <[email protected]>
Description
Adds
match_queryandmatchqueryas alternate syntax formatchfunction which currently exists in opensearchQueries can be performed using the following syntax :
Example:
These queries should return the same result as
match(field, 'query')Issues Resolved
AOS-765
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.