coady  committed d305ef6

Empty index is searchable.

  • Participants
  • Parent commits 434bd85
  • Branches default

Comments (0)

Files changed (2)

File lupyne/engine/

         return result
     def setattrs(self):
         "Customize current token."
-        pass
 class Analyzer(lucene.PythonAnalyzer):
     """Return a lucene Analyzer which chains together a tokenizer and filters.
         if count is None:
             collector = Collector()
-            count, inorder = min(count, self.maxDoc()), not weight.scoresDocsOutOfOrder()
+            count, inorder = min(count, self.maxDoc() or 1), not weight.scoresDocsOutOfOrder()
             if sort is None:
                 collector = lucene.TopScoreDocCollector.create(count, inorder)

File test/

         searcher = indexer.indexSearcher
         assert searcher is indexer.indexSearcher
+        assert not
         indexer.add(text='hello worlds', name='sample', tag=['python', 'search'])
         assert len(indexer) == 1 and list(indexer) == []
         assert not indexer.optimized