kibana/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchsource.md

3.4 KiB

Home > kibana-plugin-plugins-data-public > SearchSource

SearchSource class

Signature:

export declare class SearchSource 

Constructors

Constructor Modifiers Description
(constructor)(fields) Constructs a new instance of the SearchSource class

Properties

Property Modifiers Type Description
history SearchRequest[]

Methods

Method Modifiers Description
create()
createChild(options)
createCopy()
destroy() Completely destroy the SearchSource. {undefined}
fetch(options) Fetch this source and reject the returned Promise on error
getField(field, recurse) Get fields from the fields
getFields()
getId()
getOwnField(field) Get the field from our own fields, don't traverse up the chain
getParent() Get the parent of this SearchSource {undefined|searchSource}
getSearchRequestBody()
onRequestStart(handler) Add a handler that will be notified whenever requests start
serialize() Serializes the instance to a JSON string and a set of referenced objects. Use this method to get a representation of the search source which can be stored in a saved object.The references returned by this function can be mixed with other references in the same object, however make sure there are no name-collisions. The references will be named kibanaSavedObjectMeta.searchSourceJSON.index and kibanaSavedObjectMeta.searchSourceJSON.filter[<number>].meta.index.Using createSearchSource, the instance can be re-created.
setField(field, value)
setFields(newFields)
setParent(parent, options) Set a searchSource that this source should inherit from
setPreferredSearchStrategyId(searchStrategyId) *** PUBLIC API ***