default value of order_by_relevance param set to 10, also fixed some typos in comments

This commit is contained in:
clime
2016-04-21 10:43:45 +02:00
parent 7563fec651
commit ac5ab6544b
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ class WhoosheeQuery(BaseQuery):
# TODO: add an option to override used Whoosheer
def whooshee_search(self, search_string, group=whoosh.qparser.OrGroup,
match_substrings=True, limit=None, order_by_relevance=-1):
match_substrings=True, limit=None, order_by_relevance=10):
"""Do a fulltext search on the query.
Args:
+2 -2
View File
@@ -159,7 +159,7 @@ class BaseTestCases(object):
search_string = u' '.join([string.ascii_lowercase[i]*3 for i in range(26)])
# no sorting (this assumes (hopes) rows won't returned in the correct order by default)
# no sorting (this assumes (hopes) rows won't be returned in the correct order by default)
found_entries = self.Entry.query.whooshee_search(search_string, order_by_relevance=0).all()
titles = [int(entry.title) for entry in found_entries]
self.assertNotEqual(titles, sorted(titles, reverse=True))
@@ -169,7 +169,7 @@ class BaseTestCases(object):
titles = [int(entry.title) for entry in found_entries]
self.assertEqual(titles, sorted(titles, reverse=True))
# sort some (this assumes (hopes) the rest of the rows won't returned in the correct order by default)
# sort some (this assumes (hopes) the rest of the rows won't be returned in the correct order by default)
found_entries = self.Entry.query.whooshee_search(search_string, order_by_relevance=20).all()
titles = [int(entry.title) for entry in found_entries]
self.assertNotEqual(titles, sorted(titles, reverse=True))