Skip to content

Support combined_fields function in SQL/PPL query engine #189

Closed

Description

@chloe-zh

Related design is presented in issue #182

Todo list

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

Function details

The combined_fields function maps to the combined fields query used in the search engine. This query supports searching multiple text fields as if their contents had been indexed into one combined field.

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

Available options:

  • analyzer
  • auto_generate_synonyms_phrase_query
  • operator
  • minimum_should_match
  • zero_terms_query

Sample query:

# Search query
GET my_index/_search
{
  "query": {
    "combined_fields" : {
      "query":      "database systems",
      "fields":     [ "title", "abstract", "body"],
      "operator":   "and"
    }
  }
}

# SQL
SELECT * FROM my_index WHERE combined_fields([title, abstract, body], "database systems", operator=and)

# PPL
source=my_index | where combined_fields([title, abstract, body], "database systems", operator=and)

Activity

  1. joshuali925 commented on Jun 17, 2022

    @joshuali925
    Member

    @penghuo OpenSearch doesn't support combined_fields, should we close this or open an upstream feature request?

  2. SViradiya-MarutiTech commented on Jul 22, 2022

    @SViradiya-MarutiTech

    @brijos @penghuo Can you please let us know when we can expect this support to be added in latest OpenSearch version?, as we are upgrading AWS Elastic search to Amazon Open Search, It would be great if we add support as we have requirement of combined_fields in our query. we are using multi_match but it seems it is not working for use case.

  3. Yury-Fridlyand commented on Jul 22, 2022

    @Yury-Fridlyand
    Collaborator

    @SViradiya-MarutiTech, thank you for your feedback. combined_fields query should be implemented first in the OpenSearch itself. You are welcome to open a Feature Request in the main repo and describe your needs.

  4. SViradiya-MarutiTech commented on Jul 25, 2022

    @SViradiya-MarutiTech
  5. dai-chen commented on Aug 9, 2022

    @dai-chen
    Collaborator

    Closing this for now. We can work on this once OpenSearch adds the support. Thanks!

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