I want to use indexPatternService on server api side of plugin, e.g. to get fields for a pattern(/api/index_patterns/_fields_for_wildcard).
I know in server there is indexPatternsServiceFactory, but I don't know how to get service from it or how to use it.
I was able to get savedObjectClient with below code(found it from kibana's source code), I know something similar is needed for indexPattern. Any example is very much appreciated.
@lukas, req.getIndexPatternsService() works! don't know why I didn't print the req object! Thanks a lot. Also it has getSavedObjectsClient() as well.
Although I've got the service I'm getting 401 authentication error if I try to do:
await req.getIndexPatternsService().getFieldsForWildcard('test')
or
await req.getSavedObjectsClient().get('index-pattern', 'abcd-1234-abcd')
How can we specify to use admin cluster, so it will use auth from kibana config to call es?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.