Skip to content

Commit

Permalink
not use filter in bool query, for 1.4 version of ES (testing)
Browse files Browse the repository at this point in the history
  • Loading branch information
binux committed Jan 23, 2016
1 parent 57a2745 commit bfb0b4e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pyspider/database/elasticsearch/taskdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ def load_tasks(self, status, project=None, fields=None):
for record in elasticsearch.helpers.scan(self.es, index=self.index, doc_type=self.__type__,
query={'query': {'bool': {
'must': {'term': {'project': project}},
'filter': {'term': {'status': status}},
'should': [{'term': {'status': status}}],
'minimum_should_match': 1,
}}}, _source_include=fields or []):
yield self._parse(record['_source'])

Expand Down

0 comments on commit bfb0b4e

Please sign in to comment.