Merge "10 day count is too high"
This commit is contained in:
commit
9c468aedc0
@ -188,7 +188,8 @@ def main():
|
||||
try:
|
||||
results = classifier.hits_by_query(query['query'],
|
||||
args.queue,
|
||||
size=3000)
|
||||
size=3000,
|
||||
days=days)
|
||||
except pyelasticsearch.exceptions.InvalidJsonResponseError:
|
||||
LOG.exception("Invalid Json while collecting metrics for query %s"
|
||||
% query['query'])
|
||||
|
@ -386,12 +386,12 @@ class Classifier(object):
|
||||
self.queries_dir = queries_dir
|
||||
self.queries = loader.load(self.queries_dir)
|
||||
|
||||
def hits_by_query(self, query, queue=None, facet=None, size=100):
|
||||
def hits_by_query(self, query, queue=None, facet=None, size=100, days=0):
|
||||
if queue:
|
||||
es_query = qb.single_queue(query, queue, facet=facet)
|
||||
else:
|
||||
es_query = qb.generic(query, facet=facet)
|
||||
return self.es.search(es_query, size=size)
|
||||
return self.es.search(es_query, size=size, days=days)
|
||||
|
||||
def most_recent(self):
|
||||
"""Return the datetime of the most recently indexed event."""
|
||||
|
Loading…
Reference in New Issue
Block a user