diff test/test_indexer.py @ 4841:3ff1a288fb9c

issue2550583, issue2550635 Do not limit results with Xapian indexer Other indexer backends do not limit the number of results. Add test with searching for 123 entries on all backends, more should not be used, because the slower backends would take too much time. enquire.get_mset was limited to 10 results and since the results can be messages instead of issues, the 10 results could even be just one issue if there were many messages matching the search term before searching the messages of other issues. Additionally the few results could be filtered by other attributes, e.g. only showing open issues, which caused even less matches.
author Thomas Arendsen Hein <thomas@intevation.de>
date Mon, 21 Oct 2013 12:56:28 +0200
parents 6e3e4f24c753
children 63c79c0992ae
line wrap: on
line diff
--- a/test/test_indexer.py	Tue Oct 08 09:46:42 2013 -0400
+++ b/test/test_indexer.py	Mon Oct 21 12:56:28 2013 +0200
@@ -130,6 +130,12 @@
             self.assertSeqEqual(self.dex.find([k]),
                 [('test', '1', 'a'), ('test', '2', 'a')])
 
+    def test_manyresults(self):
+        """Test if searches find many results."""
+        for i in range(123):
+            self.dex.add_text(('test', str(i), 'many'), 'many')
+        self.assertEqual(len(self.dex.find(['many'])), 123)
+
     def tearDown(self):
         shutil.rmtree('test-index')
 

Roundup Issue Tracker: http://roundup-tracker.org/