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

[BUG] search_as_you_type not supporting multi-fields / subfields #5035

Open
iceman91176 opened this issue Nov 2, 2022 · 3 comments
Open
Labels
bug Something isn't working v2.18.0 Issues and PRs related to version 2.18.0 v3.0.0 Issues and PRs related to version 3.0.0

Comments

@iceman91176
Copy link

Describe the bug
A search_as_you_type field accepts sub-fields in its mapping definition, but they are silently ignored. This issues has bee reported in elasticsearch here (elastic/elasticsearch#56326) and has been fixed here (elastic/elasticsearch#82430)

To Reproduce
Create field title of type search_as_you_type with sub-field sortable

PUT my_test
{
  "mappings": {
    "properties": {
      "title": {
        "type": "search_as_you_type",
        "fields": {
          "sortable": {
            "type": "keyword",
            "ignore_above": 256,
            "normalizer": "lowercase_normalizer"
          }
        }
      }
    }
  },
  "settings": {
    "analysis": {
      "normalizer": {
        "lowercase_normalizer": {
          "filter": [
            "lowercase"
          ],
          "type": "custom"
        }
      }
    }
  }
}

No error, but sortable field is not present in the mapping

{
    "my_test": {
        "aliases": {},
        "mappings": {
            "properties": {
                "title": {
                    "type": "search_as_you_type",
                    "doc_values": false,
                    "max_shingle_size": 3
                }
            }
        },
        "settings": {
            "index": {
                "number_of_shards": "1",
                "provided_name": "my_test",
                "creation_date": "1667374518829",
                "analysis": {
                    "normalizer": {
                        "lowercase_normalizer": {
                            "filter": [
                                "lowercase"
                            ],
                            "type": "custom"
                        }
                    }
                },
                "number_of_replicas": "1",
                "uuid": "A8M-Yhf3ReOi3ydAs0bnwA",
                "version": {
                    "created": "136247827"
                }
            }
        }
    }
}

Expected behavior
The mapping should contain all fields

Plugins
All that are part of the default docker image

Host/Environment (please complete the following information):

  • OS: Fedora Release 36
  • Version: 2.3.0
@iceman91176 iceman91176 added bug Something isn't working untriaged labels Nov 2, 2022
@macohen macohen moved this to Next (Next Quarter) in Search Project Board Nov 16, 2022
@macohen macohen added Search Search query, autocomplete ...etc and removed Indexing & Search labels Apr 14, 2023
@andrross andrross removed the Search Search query, autocomplete ...etc label Jun 8, 2023
@macohen
Copy link
Contributor

macohen commented Jun 9, 2023

confirmed as reproduced in v2.8 of OpenSearch. we'll take a deeper look in the next few weeks.

@iceman91176
Copy link
Author

Anything new ?

@dblock
Copy link
Member

dblock commented Jun 25, 2024

@iceman91176 doesn't look like anyone is working on this. Care to help? Maybe write a YAML REST test to start?
https://github.com/opensearch-project/OpenSearch/blob/main/TESTING.md#testing-the-rest-layer

@reta reta added v3.0.0 Issues and PRs related to version 3.0.0 v2.18.0 Issues and PRs related to version 2.18.0 labels Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v2.18.0 Issues and PRs related to version 2.18.0 v3.0.0 Issues and PRs related to version 3.0.0
Projects
Status: Next (Next Quarter)
Development

No branches or pull requests

7 participants