Matt Chaput avatar 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.

Comments (0)

Files changed (1)

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):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.