lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michel Nadeau <aka...@gmail.com>
Subject Re: ConstantScoreQuery without filters
Date Thu, 11 Feb 2010 21:10:30 GMT
I think I solved my problem - used MatchAllDocsQuery() - is that the best
solution ?

- Mike
akaris@gmail.com


On Thu, Feb 11, 2010 at 3:50 PM, Michel Nadeau <akaris@gmail.com> wrote:

> Hi,
>
> I use ConstantScoreQuery to find all documents in an index like this:
>
> td = searcher.search(new ConstantScoreQuery(cluCF), null, md, cluSort);
>
> * cluCF is a Filter
> * md is int = 999
> * cluSort is a Sort
>
> My problem is that I don't always have a filter (cluCF) - so sometimes its
> value is 'null' - and Lucene crashes with a "java.lang.NullPointerException"
> error.
>
> Any idea how I can search in ALL documents without a filter?
>
> - Mike
> akaris@gmail.com
>
>
> On Thu, Feb 11, 2010 at 1:54 PM, Yuval Feinstein <yuvalf@answers.com>wrote:
>
>> Thanks Ian and Andrzej.
>> You solved a mystery for us.
>> -- Yuval
>>
>> ________________________________________
>> From: Andrzej Bialecki [ab@getopt.org]
>> Sent: Thursday, February 11, 2010 6:53 PM
>> To: java-user@lucene.apache.org
>> Subject: Re: Do deleted documents affect scores?
>>
>> On 2010-02-11 17:35, Ian Lea wrote:
>> > I'm pretty sure that the answer is no and a quick test on a small
>> > index with/without deleted docs showed no difference in the scores,
>> > using 3.0.  But that was hardly a rigorous test and I don't know
>> > enough about lucene internals and scoring to give a definitive answer.
>> >
>> > Shouldn't be too hard for you to verify or disprove: build an index
>> > and throw loads of updates and deletes at it, checking scores as you
>> > go.
>>
>> Actually, deleted docs do affect scoring for a time - IDF of a term is
>> not updated until you optimize (or when Lucene decides to merge segments).
>>
>>
>> --
>> Best regards,
>> Andrzej Bialecki     <><
>>  ___. ___ ___ ___ _ _   __________________________________
>> [__ || __|__/|__||\/|  Information Retrieval, Semantic Web
>> ___|||__||  \|  ||  |  Embedded Unix, System Integration
>> http://www.sigram.com  Contact: info at sigram dot com
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message