[pylucene-dev] Re: Bug in sample files

Ken Kinder kkinder at gmail.com
Tue May 30 23:06:20 PDT 2006


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 <kkinder at gmail.com> 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 ?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osafoundation.org/pipermail/pylucene-dev/attachments/20060531/909686f6/attachment.htm


More information about the pylucene-dev mailing list