[pylucene-dev] Index rewriting trouble

Yura Smolsky info at altervisionmedia.com
Thu Apr 13 00:56:45 PDT 2006


Hello, All.

First of all, thanks Andi for hard work of keeping PyLucene fresh :)
I checked that you have get away from SWIG. That was a huge work.

BTW, I have build last trunk easily on windows, cygwin. Thanks for
that too :)

Now I have found interesting thing. When I try to create non compound
format of index second time over existent directory then I get an error:

Traceback (most recent call last):
  File "testFSDir.py", line 8, in ?
    dirIndex = FSDirectory.getDirectory('indexTest', True)
PyLucene.JavaError: java.lang.Error: Not implemented

When I use compound format of index then it passes okay.

Maybe I miss something?

Yura Smolsky,
http://altervisionmedia.com/
-------------- next part --------------
from PyLucene import *

def indexDoc(writer, fields):
	doc = Document()
	doc.add(Field("id", str(fields['id']), Field.Store.YES, Field.Index.UN_TOKENIZED))
	writer.addDocument(doc)


def createIndex(useCompound):
	dirIndex = FSDirectory.getDirectory('indexTest', True)
	analyzer = PerFieldAnalyzerWrapper(StandardAnalyzer())

	writer = IndexWriter(dirIndex, analyzer, True)
	writer.setUseCompoundFile(useCompound)

	indexDoc(writer, {'id': 1})
	indexDoc(writer, {'id': 2})

	writer.close()
	dirIndex.close()

useCompound = False
createIndex(useCompound)
createIndex(useCompound)


More information about the pylucene-dev mailing list