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

Support multi_match function in SQL/PPL query engine #188

Closed
6 tasks
chloe-zh opened this issue Aug 20, 2021 · 1 comment
Closed
6 tasks

Support multi_match function in SQL/PPL query engine #188

chloe-zh opened this issue Aug 20, 2021 · 1 comment

Comments

@chloe-zh
Copy link
Contributor

chloe-zh commented Aug 20, 2021

Related design is presented in issue #182

Todo list

  • Support the multi_match functionality by pushing it down to the search engine
  • Enable multi_match 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_match and multimatch functions)
  • Add unit tests. (Unit tests are mandatory for all code changes.)
  • Add integration test cases for multi_match
  • Update user manual

Function details

The multi_match function maps the multi match query used in the search engine. This query builds on the match query to allow multi-field queries.

Syntax:
multi_match([field_list], query_expression[, option=<option_value>]*)

Available options:

  • analyzer
  • auto_generate_synonyms_phrase
  • boost
  • operator
  • minimum_should_match
  • lenient
  • zero_terms_query
  • type_breaker
  • cutoff_frequency
  • type (best_fields, most_fields, cross_fields, phrase, phrase_prefix, bool_prefix)

Sample queries:

# Search query 1
GET my_index/_search
{
  "query": {
    "multi_match" : {
      "query":    "this is a test", 
      "fields": [ "subject", "message" ] 
    }
  }
}

# SQL
SELECT * FROM my_index WHERE multi_match([subject, message], "this is a test")

# PPL
source=my_index | where multi_match([subject, message], "this is a test")


# Search query 2
GET my_index/_search
{
  "query": {
    "multi_match" : {
      "query":      "brown fox",
      "type":       "best_fields",
      "fields":     [ "subject", "message" ],
      "tie_breaker": 0.3
    }
  }
}

# SQL
SELECT * FROM my_index WHERE multi_match([subject, message], "brown fox", type="best_fields", tie_breaker=0.3)

# PPL
source=my_index | where multi_match([subject, message], "this is a test", type="best_fields", tie_breaker=0.3)
@acarbonetto
Copy link
Collaborator

fixed by Bit-Quill#71 and #649

@dai-chen dai-chen closed this as completed Aug 9, 2022
penghuo pushed a commit that referenced this issue Jan 3, 2023
* Fix truncate() function (#188)

Signed-off-by: Margarit Hakobyan <margarith@bitquilltech.com>
Signed-off-by: Margarit Hakobyan <margarit.hakobyan@improving.com>
opensearch-trigger-bot bot pushed a commit that referenced this issue Jan 3, 2023
* Fix truncate() function (#188)

Signed-off-by: Margarit Hakobyan <margarith@bitquilltech.com>
Signed-off-by: Margarit Hakobyan <margarit.hakobyan@improving.com>
(cherry picked from commit 7714819)
dai-chen pushed a commit that referenced this issue Jan 3, 2023
* Fix truncate() function (#188)

Signed-off-by: Margarit Hakobyan <margarith@bitquilltech.com>
Signed-off-by: Margarit Hakobyan <margarit.hakobyan@improving.com>
(cherry picked from commit 7714819)

Co-authored-by: Margarit Hakobyan <margarit.hakobyan@improving.com>
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

No branches or pull requests

3 participants