fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a2f9ed2
)
shadowing filter is not a good idea
author
Marcin Koziej
<marcin@lolownia.org>
Thu, 22 Mar 2012 10:42:01 +0000
(11:42 +0100)
committer
Marcin Koziej
<marcin@lolownia.org>
Thu, 22 Mar 2012 10:42:01 +0000
(11:42 +0100)
apps/search/index.py
patch
|
blob
|
history
diff --git
a/apps/search/index.py
b/apps/search/index.py
index
312cf94
..
4e71e25
100644
(file)
--- a/
apps/search/index.py
+++ b/
apps/search/index.py
@@
-1371,13
+1371,13
@@
class Search(IndexStore):
if terms:
return JArray('object')(terms, Term)
if terms:
return JArray('object')(terms, Term)
- def search_tags(self, query, filt
er
=None, max_results=40, pdcounter=False):
+ def search_tags(self, query, filt=None, max_results=40, pdcounter=False):
"""
Search for Tag objects using query.
"""
if not pdcounter:
"""
Search for Tag objects using query.
"""
if not pdcounter:
- filters = self.chain_filters([filt
er
, self.term_filter(Term('is_pdcounter', 'true'), inverse=True)])
- tops = self.searcher.search(query, filt
er
, max_results)
+ filters = self.chain_filters([filt, self.term_filter(Term('is_pdcounter', 'true'), inverse=True)])
+ tops = self.searcher.search(query, filt, max_results)
tags = []
for found in tops.scoreDocs:
tags = []
for found in tops.scoreDocs:
@@
-1406,12
+1406,12
@@
class Search(IndexStore):
return tags
return tags
- def search_books(self, query, filt
er
=None, max_results=10):
+ def search_books(self, query, filt=None, max_results=10):
"""
Searches for Book objects using query
"""
bks = []
"""
Searches for Book objects using query
"""
bks = []
- tops = self.searcher.search(query, filt
er
, max_results)
+ tops = self.searcher.search(query, filt, max_results)
for found in tops.scoreDocs:
doc = self.searcher.doc(found.doc)
try:
for found in tops.scoreDocs:
doc = self.searcher.doc(found.doc)
try: