Commits

Matt Chaput committed 4f8fa30

Fixed a bug where the "inlining" of postings was not disabled for vectors, so vectors
with a single term were thrown away because the terminfo object with the inlined
postings was not used. The quick fix is to write vectors with inlinelimit=0.

  • Participants
  • Parent commits 4470a88

Comments (0)

Files changed (1)

File src/whoosh/filedb/filewriting.py

         vpostwriter = self.vpostwriter
         offset = vpostwriter.start(self.schema[fieldname].vector)
         for text, weight, valuestring in vlist:
-            assert isinstance(text, text_type), "%r is not unicode" % text
+            #assert isinstance(text, text_type), "%r is not unicode" % text
             vpostwriter.write(text, weight, valuestring, 0)
-        vpostwriter.finish()
-
+        vpostwriter.finish(inlinelimit=0)
         self.vectorindex.add((docnum, fieldname), offset)
 
     def _add_vector_reader(self, docnum, fieldname, vreader):
             vpostwriter.write(vreader.id(), vreader.weight(), vreader.value(),
                               0)
             vreader.next()
-        vpostwriter.finish()
-
+        vpostwriter.finish(inlinelimit=0)
         self.vectorindex.add((docnum, fieldname), offset)
 
     def _close_all(self):