[UnifiedSearch][QueryInput] Simplify api for custom label field representation for query string #184089
Labels
enhancement
New value added to drive a business result
Feature:Unified search
Unified search related tasks
Team:Visualizations
Visualization editors, elastic-charts and infrastructure
triage_needed
Describe the feature:
An API to provide a way to map field names to custom labels for both suggestions and query strings (KQL + Lucene or just KQL).
This API should take care of both map the display value in the suggestion list to the provided one (fallback to the original name if not provided) AND provide to the affected callbacks both the raw and mapped query string (see example below).
Right now it is possible to map field names in the suggestion list with two workarounds:
suggestionAbstraction
prop who is currently limited to few entities (and not for regular fields).But the main problem remains the query when provided on
onChange
/onSubmit
callbacks as the consumer has to manipulate it directly in order to generate a valid KQL/Lucene statement.Describe a specific use case for the feature:
Given a dataView with a list of fields with long names:
it would be nice to provide a way to customize how these fields are shown or used in the query string/suggestion panel.
For instance, if the consumer would like to show only the last bit of the field name in the suggestion, like:
And use the same custom label for the KQL/Lucene query string too:
In this case on the
onChange
/onSubmit
callbacks both (or just the mapped one) can be provided as argument:The text was updated successfully, but these errors were encountered: