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

SNO 3027 kibana monitoring post refactor #294

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

Bek
Copy link
Collaborator

@Bek Bek commented Oct 2, 2020

No description provided.

@Bek Bek requested review from keenangraham and hitz October 2, 2020 18:02
@@ -94,7 +94,7 @@ def _get_or_create_search(self):
self.search = Search(
using=self._get_client(),
index=self._get_index(),
)
).extra(track_total_hits=True).query()
Copy link
Contributor

@keenangraham keenangraham Oct 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think the ES7 upgrade stuff needs to be split into its own branch, but will make a note about this now.

This should be set in an independent step to keep the coupling between the base query object and the steps that build up that query object loose (we shouldn't force the children queries to always report exact hits in other words). You can follow same pattern of adding an .extra() parameter as is done for source here:

self.search = self._get_or_create_search().extra(

Then add that step (called something like self.add_total_hits()) to the query building instructions here:

Also I don't think we want to call .query() here unless the DSL has somehow changed. You can see it is called explicitly in other places e.g.:

self.search = self._get_or_create_search().query(

Copy link
Collaborator Author

@Bek Bek Oct 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will get the changes requested in this branch: https://github.com/ENCODE-DCC/snovault/tree/SNO-172-ES7-upgrade with just the upgrade related commit. The DSL has changed in a way that breaks the test assertions. Without calling the .query(), top level field, "query": {} part of the overall query object isn't returned. Let me know which you prefer changed, test assertions or the parent class here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty Search no longer defaults to match_all query and instead leaves the query key empty. This is backwards incompatible when using suggest.

Kk. My guess is that we want to update the tests that expect this default to be returned, while making sure the tests that explicitly add a query still do so.

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

Successfully merging this pull request may close these issues.

2 participants