Skip to content

Cannot edit and save Search object #1

@omoumniabdou

Description

@omoumniabdou

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions