-
Notifications
You must be signed in to change notification settings - Fork 0
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 implementation of multi_match
similar to simple_query_string
.
#71
Conversation
Signed-off-by: Yury Fridlyand <[email protected]>
Codecov Report
@@ Coverage Diff @@
## integ-multi_match-#188 #71 +/- ##
============================================================
+ Coverage 97.69% 97.71% +0.01%
- Complexity 2777 2801 +24
============================================================
Files 269 270 +1
Lines 6859 6912 +53
Branches 437 439 +2
============================================================
+ Hits 6701 6754 +53
Misses 157 157
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
: MATCH | ||
| MATCH_PHRASE | ||
; | ||
|
||
multiFieldRelevanceFunctionName | ||
: SIMPLE_QUERY_STRING |
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.
Typo. Would be fixed by merge.
Signed-off-by: Yury Fridlyand <[email protected]>
*/ | ||
|
||
@Test | ||
public void test1() throws IOException { |
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.
test1 is not a good name for the test
+ " WHERE multi_match(['Tags'], 'taste')"; | ||
var result1 = new JSONObject(executeQuery(query1, "jdbc")); | ||
String query2 = "SELECT count(*) FROM " + TEST_INDEX_BEER | ||
+ " WHERE multi_match(['T*'], 'taste')"; |
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.
are there other variations of the wildcard we should consider? '*te'
- for example?
+ "minimum_should_match = '2<-25% 9<-3', prefix_length = 7, tie_breaker = 0.3," | ||
+ "type = most_fields, slop = 2, zero_terms_query = 'ALL');"; | ||
var result = new JSONObject(executeQuery(query, "jdbc")); | ||
assertNotEquals(0, result.getInt("total")); |
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'd prefer to see an explicit answer (like assetEquals(2, ...
).
msg); | ||
} | ||
|
||
// TODO multi_match tests: |
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.
TODO?
void multi_match() { | ||
FunctionExpression expr = dsl.multi_match(fields, query); | ||
assertEquals(String.format("multi_match(fields=%s, query=%s)", | ||
fields.getValue().toString(), query.getValue().toString()), |
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.
There's no need to call toString
in argument to String.format.
It will be called automatically -- https://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html
…y_string` both. Signed-off-by: Yury Fridlyand <[email protected]>
Signed-off-by: Yury Fridlyand [email protected]
Description
See also #66.
Issues Resolved
opensearch-project#188
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.