[pylucene-dev] ConstantScoreQuery
tsuraan at tsuraan.net
tsuraan at tsuraan.net
Thu Aug 23 12:31:33 PDT 2007
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, tsuraan at tsuraan.net 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
> pylucene-dev at osafoundation.org
> http://lists.osafoundation.org/mailman/listinfo/pylucene-dev
More information about the pylucene-dev
mailing list