X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/5074895f7d96cbd5fda6a4d566ddb25533137fd4..2e45f239552a9e378a9e1f65274dfb7c13df220d:/src/search/index.py diff --git a/src/search/index.py b/src/search/index.py index ce60978d5..bfb1739b1 100644 --- a/src/search/index.py +++ b/src/search/index.py @@ -271,14 +271,14 @@ class Index(SolrIndex): 'dramat_wierszowany_lp', 'dramat_wspolczesny', 'liryka_l', 'liryka_lp', 'wywiad', - ] + ] ignore_content_tags = [ - 'uwaga', 'extra', 'nota_red', + 'uwaga', 'extra', 'nota_red', 'abstrakt', 'zastepnik_tekstu', 'sekcja_asterysk', 'separator_linia', 'zastepnik_wersu', 'didaskalia', 'naglowek_aktu', 'naglowek_sceny', 'naglowek_czesc', - ] + ] footnote_tags = ['pa', 'pt', 'pr', 'pe'] @@ -670,7 +670,7 @@ class SearchResult(object): 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 @@ -744,7 +744,7 @@ class Search(SolrIndex): 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): """