From e3ab2e52e92d146549e95bebeff414595e9baf96 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 13 Nov 2022 19:01:41 -0800 Subject: [PATCH] Preserve search query, bindings, and explain. --- etiquette/objects.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/etiquette/objects.py b/etiquette/objects.py index bf074a4..d9a34f4 100644 --- a/etiquette/objects.py +++ b/etiquette/objects.py @@ -1676,6 +1676,9 @@ class Search: self.generator_started = False self.generator_exhausted = False self.more_after_limit = None + self.query = None + self.bindings = None + self.explain = None self.start_time = None self.end_time = None self.start_commit_id = None @@ -1934,11 +1937,12 @@ class Search: query = ' '.join(query) - query = f'{"-" * 80}\n{query}\n{"-" * 80}' + self.query = query + self.bindings = bindings + self.explain = self.photodb.explain(query, bindings) - log.debug('\n%s %s', query, bindings) - log.loud(self.photodb.explain(query, bindings)) - generator = self.photodb.select(query, bindings) + log.loud(self.explain) + generator = self.photodb.select(self.query, self.bindings) seen_albums = set() offset = kwargs.offset for row in generator: