-
Notifications
You must be signed in to change notification settings - Fork 8
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
base: dev
Are you sure you want to change the base?
Conversation
@@ -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() |
There was a problem hiding this comment.
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:
self.add_source() |
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( |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
No description provided.