Index alias does not show up in discover

I have created aliases to an existing index via update alias as shown in https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html in dev tools.

When i use dev tools via GET / it creates a popup with all options allowed for GET including the index aliases i have created. All aliases operations in dev tools work as expected.

When i go to discovery, only the actual index show up in drop down list and not the aliases i have created. I'm using the latest V 7.5.0 release.

It states in the documentation that aliases are used just like index.

My Kibana plugin is banking on the aliases showing up in discovery / kibaban lens as if they were index as stated in the documentation.

Am i missing something? Do i need to modify Kibana configuration to enable this option? is there anything else to do to have this functionality?

Hi Peter!

You must first set up "Index Patterns" in Kibana's Settings before you can access these aliases in Kibana's UI. You can use wildcards in these patterns to match multiple aliases or index names. See the documentation here: https://www.elastic.co/guide/en/kibana/current/tutorial-define-index.html

Let me know if this still doesn't work or you have any other questions!

Josh
Thanks for the quick reply. Is there any way to perform this operation programmatically ?
I'm creating these aliases via my kibana plugin that i'm writing. Once they are created , can the "setup Index pattern" operation be done via REST API?

Yes they can be. Index Patterns are stored as "Saved Objects" in the .kibana index. You can create these objects using the Saved Objects API. The docs for this API actually use Index Patterns as an example: https://www.elastic.co/guide/en/kibana/current/saved-objects-api-create.html

Josh,
One last question: Why does it show in dev tools via GET / and not discover?

Dev Tools simply access Elasticsearch APIs directly, while Discover only shows the Index Patterns that Kibana has configured.

Josh,
Thanks for the answers. I really appreciate it.!

Josh,
I noticed the create Save Object APIU is marked as experimental in the docs. Will that be maintained in the future?
As well, I'm using the elasticsearch javascript api for all kibana calls. For example the 'indices.updateAliases' is used to update the aliases.
Whats the equivalent for Saved Object API?

Josh,
Can i specify a mapping for an index alias in a similar manner as would be defined for an index? What i want to do is present to the user a subset of the of all the fields in an index.

I noticed the create Save Object APIU is marked as experimental in the docs. Will that be maintained in the future?

It will be maintained, though we may make breaking changes to the API in minor versions. We publish these changes in blog posts to help you keep up with them

We don't have an equivalent public client for usage outside Kibana, but if you're using this from Kibana plugin code, you can use the SavedObjectsClient that is available via core.savedObjects passed in to your plugin's setup function.

Can i specify a mapping for an index alias in a similar manner as would be defined for an index?

I believe you can set the mappings manually. We don't have any examples of this, but my suggestion would be to go to the Index Pattern setting screen and try creating/modifying an index pattern while inspecting the network requests to see what data is set.

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