Skip to content

Support match_phrase_prefix function in SQL/PPL query engine #186

Closed

Description

@chloe-zh

Related design is presented in issue #182

Todo list

  • Support the match_phrase_prefix functionality by pushing it down to the search engine
  • Enable match_phrase_prefix function 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_phrase_prefix
  • Update user manual

Function details

The match_phrase_prefix function maps to the match phrase prefix query used in search engine. This query returns documents that contains the words of a provided text, in the same order as provided. The last term of the provided text is treated as a prefix, matching any words that begin with that term.

Syntax:
match_phrase_prefix(field_expression, query_expression[, option=<option_value>]*)

Available options:

  • analyzer
  • max_expansions
  • slop
  • zero_terms_query

Sample queries:

# Search query
GET my_index/_search
{
  "query": {
    "match_phrase_prefix": {
      "message": {
        "query": "quick brown f"
      }
    }
  }
}

# SQL
SELECT * FROM my_index WHERE match_phrase_prefix(message, "quick brown f")

# PPL
source=my_index | where match_phrase_prefix(message, "quick brown f")

Activity

  1. added a commit that references this issue on Jun 16, 2022
  2. acarbonetto commented on Aug 4, 2022

    @acarbonetto
    Collaborator

    fixed by #661 and Bit-Quill#79

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions