[pylucene-dev] Error when using PyLucene (LIA) example

Andi Vajda vajda at osafoundation.org
Fri Aug 18 03:18:09 PDT 2006


> On Thu, 17 Aug 2006, Viksit Gaur wrote:
>
>> I've been facing a weird error when running the first example in the LIA
>> series - Indexer.py. I'm using FC5 and the compiled PyLucene version for
>> Ubuntu. Might anyone have an idea why I'm facing these?
>
> I've reproduced the bug, a fix should follow shortly.

The fix is included in the attached patch. It's also checked into svn.

Andi..
-------------- next part --------------
Index: samples/LuceneInAction/lia/meetlucene/Indexer.py
===================================================================
--- samples/LuceneInAction/lia/meetlucene/Indexer.py	(revision 284)
+++ samples/LuceneInAction/lia/meetlucene/Indexer.py	(working copy)
@@ -82,9 +82,8 @@
         else:
             print 'Indexing', path
             doc = Document()
-            doc.add(Field("contents", InputStreamReader(file, 'iso-8859-1'),
-                          Field.Store.YES, Field.Index.TOKENIZED))
-            doc.add(Field("filename", os.path.abspath(path),
+            doc.add(Field("contents", InputStreamReader(file, 'iso-8859-1')))
+            doc.add(Field("path", os.path.abspath(path),
                           Field.Store.YES, Field.Index.UN_TOKENIZED))
             writer.addDocument(doc)
             file.close()


More information about the pylucene-dev mailing list