When I retrive a Search object for which I want to edit the kibanaSavedObjectMeta the save does nothing:
Search._d_ do not contains the search AttrDict and thus the saving that calls to_dictdoes not save anything
Search.search return a dict instead of AttrDict but it is not stored in the object
- The following code should change the index used in
search_source(a Search object) but does not save anything
# change index pattern
search_source = src_search.search.get("kibanaSavedObjectMeta", {}).get(
"searchSourceJSON", ""
)
source = json.loads(search_source)
if "index" in source:
source["index"] = "another_index"
src_search.search["kibanaSavedObjectMeta"][
"searchSourceJSON"
] = json.dumps(source)
src_search.save(index=slave_kibana_index)
The problem is probably related to the keyword search that is also used as a static method (Document.search)
When I retrive a
Searchobject for which I want to edit thekibanaSavedObjectMetathe save does nothing:Search._d_do not contains thesearchAttrDict and thus the saving that callsto_dictdoes not save anythingSearch.searchreturn a dict instead of AttrDict but it is not stored in the objectsearch_source(a Search object) but does not save anythingThe problem is probably related to the keyword
searchthat is also used as a static method (Document.search)