m.update(f[self.OTHER])
hits.append(m)
- hits.sort(lambda a, b: cmp(a['score'], b['score']), reverse=True)
+ hits.sort(key=lambda h: h['score'], reverse=True)
self._processed_hits = hits
else:
query = self.index.query()
query = self.apply_filters(query, filters).field_limit(score=True, all_fields=True)
- return [SearchResult(found, how_found='search_words') for found in query.execute()]
+ return [SearchResult(found, how_found='search_words', query_terms=words) for found in query.execute()]
def get_snippets(self, searchresult, query, field='text', num=1):
"""