Plugin Help with Queries

Hello,

I'm making my own Kibana plugin based on Kibana and Elasticsearch 7.x. I'm creating a new visualization that will show data from index A based on values selected from index B.

To put this more clearly, our Elasticsearch has two indexes, Data and Config. The dashboard visualizations are configured to pull and display from the Data index. I want my new plugin to pull specific field values from the Data index based on the users time range. Collect the field values then issue a new search on the Config index finding documents with the specific field values.

I created my own Request Handler but now I wish to create a new searchSource where I can define the index and the kuery in order to find the right documents.

Can someone explain how to create a new searchSource?

Thank you,
Fonzy Mantooth

Hi, does this section or the rest of these docs help?

cc @nreese

Jen-Huang,

Than you for this document and it will certainly help, however the API must have changed because the method calls in the document do not match what is available in SearchSource.
For example, there is no searchSource.size() method
There is no searchSource.index() method
There is no searchSource.aggs() method.

This does help me with at least creating the object. I'm thinking the API has changed to use the searchSource.setFields() but not sure if that is correct or the method signature.

Thanks!

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