Ok, thanks! I guess this is a question more suitable to the Lucene list, but do you know if a FilteredQuery using MatchAllDocsQuery and a filter is any less efficient than a ConstantScoreQuery? I'm not seeing any problems with that approach in my testing, and I can't upgrade my PyLucene at the moment, so I guess I'll probably go with it unless someone says that it's horribly inefficient.

On Aug 23, 2007, at 12:15 PM, Andi Vajda wrote:


On Thu, 23 Aug 2007, [EMAIL PROTECTED] wrote:

Is it possible to create a ConstantScoreQuery using a python-defined filter? I'm trying the following, and I get the pasted error:

class MyFilter(object):
...  def bits(self, reader):
...   return BitSet()
...
f=MyFilter()
q=ConstantScoreQuery(f)
Traceback (most recent call last):
 File "<stdin>", line 1, in ?
pybackend.thirdparty.PyLucene.lnxpyd.PyLucene.InvalidArgsError: (<type 'PyLucene.ConstantScoreQuery'>, '__init__', (<__main__.MyFilter object at 0xb7cda14c>,))

There is a bug in the ConstantScoreQuery constructor wrapper. It's not setup to accept python filters. I fixed that now in svn rev 338.

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

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

Reply via email to