-
Notifications
You must be signed in to change notification settings - Fork 190
Support match_phrase function in SQL/PPL query engine #185
Copy link
Copy link
Closed
Description
Related design is presented in issue #182
Todo list
- Support the
match_phrasefunctionality by pushing it down to the search engine - Enable
match_phrasefunction 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_phraseandmatchphrasefunctions 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.
Syntax:
match_phrase(field_expression, query_expression[, option=<option_value>]*)
Available options:
- analyzer
- zero_terms_query
Sample queries:
# 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")
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels