added ordering support for text queries

This commit is contained in:
Wilson Júnior
2014-07-08 08:38:41 -03:00
parent 89825a2b21
commit 30c01089f5
3 changed files with 32 additions and 1 deletions

View File

@@ -1549,6 +1549,13 @@ class BaseQuerySet(object):
for key in keys:
if not key:
continue
if key == '$text_score':
# automatically set to include text scores
self._include_text_scores = True
key_list.append(('text_score', {'$meta': "textScore"}))
continue
direction = pymongo.ASCENDING
if key[0] == '-':
direction = pymongo.DESCENDING