fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
80ab7c8
)
forgot to remove self
author
Marcin Koziej
<marcin@lolownia.org>
Thu, 5 Apr 2012 10:33:57 +0000
(12:33 +0200)
committer
Marcin Koziej
<marcin@lolownia.org>
Thu, 5 Apr 2012 10:33:57 +0000
(12:33 +0200)
apps/search/index.py
patch
|
blob
|
history
diff --git
a/apps/search/index.py
b/apps/search/index.py
index
6883978
..
b689c76
100644
(file)
--- a/
apps/search/index.py
+++ b/
apps/search/index.py
@@
-346,7
+346,8
@@
class Index(BaseIndex):
book_doc = self.create_book_doc(book)
meta_fields = self.extract_metadata(book, book_info, dc_only=['source_name', 'authors', 'title'])
# let's not index it - it's only used for extracting publish date
book_doc = self.create_book_doc(book)
meta_fields = self.extract_metadata(book, book_info, dc_only=['source_name', 'authors', 'title'])
# let's not index it - it's only used for extracting publish date
- del meta_fields['source_name']
+ if 'source_name' in meta_fields:
+ del meta_fields['source_name']
for f in meta_fields.values():
if isinstance(f, list) or isinstance(f, tuple):
for f in meta_fields.values():
if isinstance(f, list) or isinstance(f, tuple):
@@
-1066,7
+1067,7
@@
class Search(IndexStore):
return toks
@staticmethod
return toks
@staticmethod
- def fuzziness(
self,
fuzzy):
+ def fuzziness(fuzzy):
"""Helper method to sanitize fuzziness"""
if not fuzzy:
return None
"""Helper method to sanitize fuzziness"""
if not fuzzy:
return None
@@
-1104,7
+1105,7
@@
class Search(IndexStore):
return phrase
@staticmethod
return phrase
@staticmethod
- def make_term_query(
self,
tokens, field='content', modal=BooleanClause.Occur.SHOULD, fuzzy=False):
+ def make_term_query(tokens, field='content', modal=BooleanClause.Occur.SHOULD, fuzzy=False):
"""
Returns term queries joined by boolean query.
modal - applies to boolean query
"""
Returns term queries joined by boolean query.
modal - applies to boolean query