You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support match_phrase function in SQL/PPL query engine #185
Support the match_phrase functionality by pushing it down to the search engine
Enable match_phrase function in SQL and PPL syntax and parser, including all the available parameters
Make sure the function in new engine is compatible with the old engine support (including match_phrase and matchphrase functions in old engine)
Add unit tests. (Unit tests are mandatory for all code changes.)
Add integration test cases for match_phrase
Update user manual
Function details
The match_phrase function maps to the match phrase query used in search engine. This query analyzes the text and creates a phrase query out of the analyzed text.
# Search query 1
GET my_index/_search
{
"query": {
"match_phrase": {
"message": "this is a test"
}
}
}
# SQL
SELECT * FROM my_index WHERE match_phrase(message, "this is a test")
# PPL
source=my_index | match type=match_phrase field=message query="this is a test"
# Search query 2
GET my_index/_search
{
"query": {
"match_phrase": {
"message": {
"query": "this is a test",
"analyzer": "my_analyzer"
}
}
}
}
# SQL
SELECT* FROM my_index WHERE match_phrase(message, "this is a test", analyzer="my_analyzer")
# PPL
source=my_index | where match_phrase(message, "this is a test", analyzer="my_analyzer")
Activity
Merge branch 'dev-match_phrase-#185' of https://github.com/Bit-Quill/…
Merge branch 'dev-match_phrase-#185' of github.com:Bit-Quill/opensear…
MaxKsyunz commentedon May 5, 2022
@penghuo, should the PPL parser support alternative spelling of
match_phraselikematchphrase?For example, are queries like
source=index | where matchphrase(field, 'text')valid?Merge branch 'dev-match_phrase-#185' of https://github.com/Bit-Quill/…
joshuali925 commentedon May 6, 2022
@MaxKsyunz
match_pharseshould be enough, i don't think PPL functions support alternative spellings (there isdate_format()but notdateformat())MaxKsyunz commentedon May 12, 2022
@joshuali925, here's a demo of the changes in PR #604
match_phrase.demo-web.mp4
Merge branch 'dev-match_phrase-#185-matchphrase_revB' into integ-matc…
Merge branch 'main' into integ-match_phrase-#185
acarbonetto commentedon Aug 4, 2022
fixed by: #604