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 match_phrase_prefix #661

Merged

Conversation

MaxKsyunz
Copy link
Collaborator

@MaxKsyunz MaxKsyunz commented Jun 28, 2022

Description

Add support for match_phrase_prefix in SQL and PPL.

Issues Resolved

#186

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.

MaxKsyunz and others added 30 commits June 3, 2022 17:55
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
Change generateQueries signature to use more appropriate Map type.

Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
…quired

Add match_phrase_prefix to SQL with required parameters.
Private constants look odd.

Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
A convenience method to simplify writing tests.

Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
…l-opt

match_phrase_prefix in SQL with optional parameters
…refix-#186

# Conflicts:
#	core/src/main/java/org/opensearch/sql/expression/DSL.java
#	core/src/main/java/org/opensearch/sql/expression/function/OpenSearchFunctions.java
#	core/src/test/java/org/opensearch/sql/analysis/ExpressionAnalyzerTest.java
#	opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/filter/FilterQueryBuilder.java
#	opensearch/src/test/java/org/opensearch/sql/opensearch/storage/script/filter/FilterQueryBuilderTest.java
#	sql/src/main/antlr/OpenSearchSQLLexer.g4
#	sql/src/main/antlr/OpenSearchSQLParser.g4
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
…l-req

Add match_phrase_prefix support to where command in PPL
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
…l-itests

Add integration tests for match_phrase_prefix in SQL
- match_phrase was used in a couple places.
- some optional parameters were missing.

Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
MaxKsyunz and others added 6 commits June 23, 2022 09:48
match_phrase_prefix documentation for SQL and PPL
…l_it

Integration tests for match_phrase_prefix in PPL
…refix-#186

# Conflicts:
#	core/src/main/java/org/opensearch/sql/expression/DSL.java
#	docs/user/dql/functions.rst
#	docs/user/ppl/functions/relevance.rst
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>
Add support for match_phrase_prefix in SQL and PPL
@MaxKsyunz MaxKsyunz requested a review from a team as a code owner June 28, 2022 07:52
…prefix-#186

Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>

# Conflicts:
#	core/src/main/java/org/opensearch/sql/expression/function/BuiltinFunctionName.java
#	docs/user/dql/functions.rst
#	opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/filter/FilterQueryBuilder.java
#	ppl/src/main/antlr/OpenSearchPPLLexer.g4
#	ppl/src/main/antlr/OpenSearchPPLParser.g4
#	sql/src/main/antlr/OpenSearchSQLParser.g4
acarbonetto
acarbonetto previously approved these changes Jun 28, 2022
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 your changes!

.put("slop", (b, v) -> b.slop(Integer.parseInt(v.stringValue())))
.put("max_expansions", (b, v) -> b.maxExpansions(Integer.parseInt(v.stringValue())))
.put("zero_terms_query", (b, v) -> b.zeroTermsQuery(
org.opensearch.index.search.MatchQuery.ZeroTermsQuery.valueOf(v.stringValue())))
Copy link
Collaborator

Choose a reason for hiding this comment

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

np: use import statement instead?

Copy link
Collaborator

@penghuo penghuo 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 change!

@penghuo penghuo merged commit e180d56 into opensearch-project:main Jul 11, 2022
@MaxKsyunz MaxKsyunz deleted the integ-match_phrase_prefix-#186 branch July 26, 2022 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants