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

1.1 KiB

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

SearchSource.serialize() method

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.

Signature:

serialize(): {
        searchSourceJSON: string;
        references: SavedObjectReference[];
    };

Returns:

{ searchSourceJSON: string; references: SavedObjectReference[]; }