Use of field aliases in app search

Apologies if this has been covered previously, but is it possible to use field aliases or a display names for fields in app search ?

Hey @ndosa,

We don't have anything like that. Not sure what your use case is but this is something you can easily handle in your consuming code, i.e., mapping a field name to a display name.

Jason

Thanks for getting back to me Jason, we are designing a search function for a documents where attributes have a human readable name and also an identifier, so wondering how to make search, filtering and sorting more user-friendly, based on the actual human readable name (which contains spaces and other characters that are invalid for an app search field).

I suppose what you're saying is to look at the search-ui for a way to map field identifiers to their human readable names ?

Thanks again

Are you using the search-ui library?

Regardless of what you're using for your front end you'll need to map to display values at some point. You'd basically just have a field name to display name hash that you check any time before rendering a display value to the page.

We do this on https://www.elastic.co/search, for instance. The product names listed on the left are all display friendly values. Before rendering, we do a bit of formatting ... upper case, convert dashes to spaces, and also look up display names from a hash.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.