-
Notifications
You must be signed in to change notification settings - Fork 190
Support match_bool_prefix function in SQL/PPL query engine #187
Copy link
Copy link
Closed
Description
Related design is presented in issue #182
Todo list
- Support the
match_bool_prefixfunctionality by pushing it down to the search engine - Enable
match_bool_prefixfunction in SQL and PPL syntax and parser, including all the available parameters - Add unit tests. (Unit tests are mandatory for all code changes.)
- Add integration test cases for
match_bool_prefix - Update user manual
Function details
The match_bool_prefix function maps to the match bool prefix query in the search engine. This query analyzes its input and constructs a bool query from the terms. Each term except the last is used in a term query. The last term is used in a prefix query.
Syntax:
match_phrase_prefix(field_expression, query_expression[, option=<option_value>]*)
Available options:
- minimum_should_match
- fuziness
- prefix_length
- max_expansions
- fuzzy_transpositions
- fuzzy_rewrite
Sample queries:
# Search query
GET my_index/_search
{
"query": {
"match_bool_prefix": {
"message": {
"query": "quick brown f",
"analyzer": "keyword"
}
}
}
}
# SQL
SELECT * FROM my_index WHERE match_bool_prefix(message, "quick brown f", analyzer="keyword")
# PPL
source=my_index | where match_bool_prefix(message, "quick brown f", analyzer="keyword")
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels