Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[eem] metadata as keyword (elastic#202611)
Cast identity fields and metadata fields as keyword to prevent ambiguous mappings error ### Testing - setup data ``` PUT service-name-as-keyword { "mappings": { "dynamic": false, "properties": { "service.name": { "type": "keyword" } } } } POST service-name-as-keyword/_doc { "service.name": "as-keyword" } PUT service-name-as-text { "mappings": { "dynamic": false, "properties": { "service.name": { "type": "text" } } } } POST service-name-as-text/_doc { "service.name": "as-text" } ``` - data loads successfully in `/app/entity_manager` ![Screenshot 2024-12-03 at 11 50 10](https://github.com/user-attachments/assets/12d6cbd8-c075-475f-b140-9158e93158ff) _new query_ ``` POST _query { "query": """FROM service-name-as* | WHERE service.name::keyword IS NOT NULL | STATS BY service.name::keyword | RENAME `service.name::keyword` AS service.name | EVAL entity.type = "service", entity.id = service.name, entity.display_name = entity.id | SORT entity.id ASC | LIMIT 10""" } ``` - previous query fails with ambiguous mappings error ``` POST _query { "query": """FROM service-name-as* | WHERE service.name IS NOT NULL | STATS BY service.name | EVAL entity.type = "service", entity.id = service.name, entity.display_name = entity.id | SORT entity.id ASC | LIMIT 10""" } ```
- Loading branch information