Here's a fix:

--- /home/kkinder/PyLucene-src-2.0.0.orig/samples/SearchFiles.py        2005-12-03 12:38:32.000000000 -0700
+++ SearchFiles.py      2006-05-31 00:05:24.000000000 -0600
@@ -21,7 +21,7 @@

         print
         print "Searching for:", command
-        query = QueryParser.parse(command, "contents", analyzer)
+        query = QueryParser("contents", analyzer).parse(command)
         hits = searcher.search(query)
         print "%s total matching documents." % hits.length()
         for i, doc in hits:


On 5/31/06, Ken Kinder <[EMAIL PROTECTED]> wrote:
In SearchFiles.py , when you run a query, you get:

Traceback (most recent call last):
  File "SearchFiles.py", line 37, in ?
    run(searcher, analyzer)
  File "SearchFiles.py", line 24, in run
    query = QueryParser.parse(command, "contents", analyzer)
TypeError: descriptor 'parse' requires a 'PyLucene.QueryParser' object but received a 'str'

Looks like it expects an instance of PyLucene.QueryParser ?

_______________________________________________
pylucene-dev mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev

Reply via email to