Skip to content

Commit

Permalink
bug 636095, handle big versions better
Browse files Browse the repository at this point in the history
  • Loading branch information
davedash committed Mar 4, 2011
1 parent 6b31b41 commit 5556331
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions apps/search/client.py
Expand Up @@ -293,7 +293,6 @@ def restrict_version(self, version):
"""

sc = self.sphinx

high_int = convert_version(version)
low_int = high_int

Expand All @@ -304,7 +303,7 @@ def restrict_version(self, version):
# lower-bound. To work-around this limitation we set max_ver's
# upperbound to be ridiculously large.
if high_int:
sc.SetFilterRange('max_ver', low_int, MAX_VERSION)
sc.SetFilterRange('max_ver', low_int, low_int + MAX_VERSION)
sc.SetFilterRange('min_ver', 0, high_int)

def add_meta_query(self, field, term):
Expand Down
1 change: 1 addition & 0 deletions apps/search/tests/test_client.py
Expand Up @@ -172,6 +172,7 @@ def test_version_restriction(self):
"""This tests that sphinx will properly restrict by version."""
eq_(query("Delicious version:3.6")[0].id, 3615)
eq_(len(query("Delicious version:4.0")), 0)
eq_(len(query("Delicious version:10.2.152")), 0)

def test_sorts(self):
"""
Expand Down

0 comments on commit 5556331

Please sign in to comment.