Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot edit and save Search object #1

Open
omoumniabdou opened this issue Mar 26, 2021 · 0 comments
Open

Cannot edit and save Search object #1

omoumniabdou opened this issue Mar 26, 2021 · 0 comments

Comments

@omoumniabdou
Copy link
Contributor

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant