i'm trying to port some Java Lucene code into pylucene (v 2.3.1). i'm using the examples in http://svn.apache.org/viewcvs.cgi/lucene/pylucene/trunk/samples/, and most of pylucene seems to come into my python (ubuntu 12.04, pydev 2.6.0, eclipse 3.7.2) enviroment just fine. eg, i'm able execute lucene.initVM() (showing JCC is in place) and to define a Porter stemmer following the example taken from .../samples/PorterStemmerAnalyzer.py via:
self.analyzer = PorterStemmerAnalyzer()
but when i try to create a new IndexWriter, it stumbles on the last argument to its constructor:
self.writer = lucene.IndexWriter(self.store, self.analyzer, True, lucene.IndexWriter.MaxFieldLength.LIMITED)
i get this error:
AttributeError: type object 'IndexWriter' has no attribute 'MaxFieldLength'.
this is the error that has me stumped at the moment, but there are several other hacks (from their version .../samples) i had also made (but also worry about):
replace lucene.Version.LUCENE_CURRENT with lucene.LucenePackage
lucene.SimpleFSDirectory with lucene.MMapDirectory
in order to get this far.
http://lucene.apache.org/pylucene/features.html says "The PyLucene API exposes all Java Lucene classes in a flat namespace in the PyLucene module." this doesn't seem entirely right, lucene.StopAnalyzer.ENGLISH_STOP_WORDS_SET is known to pydev while lucene.ENGLISH_STOP_WORDS_SET is not.
so it seems i am getting part of/an old version of/...? pylucene engaged correctly, but not all of it!? why might this be?