Sorry, had a bit of a backlog in my To Do list - was waiting for python 2.5 so I could eliminate that as a cause before posting.

PyLucene works fine like this:

store = FSDirectory.getDirectory('/tmp/foo', True)

But the Java Lucene 2.1 docs say:

|static FSDirectory <cid:[email protected]>| |*getDirectory <cid:[email protected]>*(String <http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html> path, boolean create)| *Deprecated.* /Use IndexWriter's create flag, instead, to create a new index.

/So I decided to switch to the alternative signature without the create boolean:

|static FSDirectory <cid:[email protected]>| |*getDirectory <cid:[email protected]>*(String <http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html> path)|
         Returns the directory instance for the named location.

But PyLucene didn't like that:

---
[EMAIL PROTECTED] ~/proj/search/trunk]$ ~/bin/foo.py
PyLucene 2.1.0-1 Lucene 2.1.0-509013
Traceback (most recent call last):
 File "/home/ofer/bin/foo.py", line 14, in <module>
   store = PyLucene.FSDirectory.getDirectory(directory)
PyLucene.InvalidArgsError: (<type 'PyLucene.FSDirectory'>, 'getDirectory', ('/tmp/foo',))
---

Here's the script:

---
#!/bin/env python2.5
import PyLucene
print 'PyLucene', PyLucene.VERSION, 'Lucene', PyLucene.LUCENE_VERSION
directory = '/tmp/foo'
store = PyLucene.FSDirectory.getDirectory(directory)
#store = PyLucene.FSDirectory.getDirectory(directory, True)
store.close()
---

-ofer

PS-Just checked one last thing - apparently, just importing PyLucene is enough to have the process reported as multi-threaded in the STAT column of 'ps'.
_______________________________________________
pylucene-dev mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev

Reply via email to