Skip to content

Option for strict validation of query field names #26013

@markharwood

Description

@markharwood

Currently, much of what could be validated in queries and aggregations goes unchecked because of the fundamental assumption that we might be querying across heterogenous indexes where certain fields may be "unmapped".
A mis-typed field name or an invalid nested reference goes unchecked and returns no results rather than throwing any kind of error or warning. The users that enforce strict mappings across indexes are penalized by elasticsearch's need to support users with sloppier configurations.
Bad queries on strict schemas fail silently.

This issue proposes that we provide a new strict=true query option that checks all field names in query and agg clauses to ensure at query time that they actually relate to mapped fields. Any nested clauses will also check that subclauses are referencing nested fields correctly.
If strict query mode is set to "true" then errors will be thrown for unmapped fields. If strict is "false" (the default) then warnings could be passed back with search results.

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Search/SearchSearch-related issues that do not fall into other categories>enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions