Skip to content

[FEATURE] Support search for fields in text #1113

Closed as not planned
Closed as not planned

Description

@Yury-Fridlyand

Is your feature request related to a problem?

/**
* Convert multi-field text field name to its inner keyword field. The limitation and assumption
* is that the keyword field name is always "keyword" which is true by default.
*
* @param fieldName field name
* @param fieldType field type
* @return keyword field name for multi-field, otherwise original field name returned
*/
protected String convertTextToKeyword(String fieldName, ExprType fieldType) {
if (fieldType == OPENSEARCH_TEXT_KEYWORD) {
return fieldName + ".keyword";
}
return fieldName;
}

/**
* Text field doesn't have doc value (exception thrown even when you call "get")
* Limitation: assume inner field name is always "keyword".
*/
public static String convertTextToKeyword(String fieldName, ExprType fieldType) {
if (fieldType == OPENSEARCH_TEXT_KEYWORD) {
return fieldName + ".keyword";
}
return fieldName;
}

  1. convertTextToKeyword is not used everywhere (e.g. relevance search functions);
  2. fields property could has any name;
  3. There are 2 duplicate functions.
{
  "mappings": {
    "properties": {
      "motto": {
        "type": "text",
        "fields": {
          "words": {
            "type": "keyword",
            "ignore_above": 256
          }
        }
      }
    }
  }
}

What solution would you like?

Use mapping info to properly set fields name - words in the given sample.

What alternatives have you considered?

Add limitation section to documentation and return error on querying such kind of fields (aka columns).

Do you have any additional context?

Related to #794, #1038 and #1112.

Activity

  1. added
    enhancement
    on Nov 26, 2022
  2. added
    PPL
    on May 29, 2025
  3. added
    engine v2
    on Aug 11, 2025
  4. LantaoJin commented on Aug 11, 2025

    @LantaoJin
    Member

    This issue should only be present in v2 only. Add v2 label.

  5. moved this from Not Started to Won't do in PPL Trackeron Aug 11, 2025
  6. moved this from Won't do to Done in PPL Trackeron Mar 26, 2026
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

    PPLengine v2enhancement

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions