You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Jason Fennell <jd...@gmail.com> on 2009/12/09 19:48:00 UTC

MatchAllDocsQuery and InstantiatedIndex on Lucene 2.9.1

I'm trying to upgrade our application from Lucene 2.4.1 to Lucene 2.9.1.
I've been using an InstantiatedIndex to do a bunch of unit testing, but am
running into a some problems with Lucene 2.9.1.
In particular, when I try to run a MatchAllDocsQuery on my InstantiatedIndex
(which worked fine on 2.4.1) a NullPointerException is raised.  I think I
tracked down the problem in the Lucene source.

In the 2.9.1 MatchAllDocsQuery, the MatchAllScorer retrieves termDocs from
the IndexReader passed to it with

reader.termDocs(null)

which I assume is supposed to return all termDocs.  However, tracing this
call down

IndexReader.termDocs(term) calls InstantiatedTermDocs.seek(
term) calls InstantiatedIndex.findTerm(term)

which is implemented as

InstantiatedTerm findTerm(Term term) {
    return findTerm(term.field(), term.text());
}

which, since term is null, results in a NullPointerException.  This seems to
me like an bug either in the MatchAllDocsQuery implementation (the version
in 2.4.1 did not use termDocs, so did not pass through this null), or a bug
in the implementation of InstantiatedIndex.

Any suggestions on what I can do about this?  I definitely can't get rid of
the MatchAllDocsQuery and don't really want to move back to a slow
RAMDirectory.

Re: MatchAllDocsQuery and InstantiatedIndex on Lucene 2.9.1

Posted by Jason Fennell <jd...@gmail.com>.
Thanks for the fast reply & patch!

On Thu, Dec 10, 2009 at 12:20 PM, Karl Wettin <ka...@gmail.com> wrote:

> https://issues.apache.org/jira/browse/LUCENE-2144
>
> 9 dec 2009 kl. 23.22 skrev Uwe Schindler:
>
>
>  This is a bug in InstantiatedIndex. The termDoc(null) was added to get all
>> documents. This was never implemented in Instantiated Index. Can you open
>> an
>> issue?
>>
>> There maybe other queries fail because of this (e.g.
>> FieldCacheRangeFilter,...).
>>
>> -----
>> Uwe Schindler
>> H.-H.-Meier-Allee 63, D-28213 Bremen
>> http://www.thetaphi.de
>> eMail: uwe@thetaphi.de
>>
>>  -----Original Message-----
>>> From: Jason Fennell [mailto:jdfennell@gmail.com]
>>> Sent: Wednesday, December 09, 2009 7:48 PM
>>> To: java-user@lucene.apache.org
>>> Subject: MatchAllDocsQuery and InstantiatedIndex on Lucene 2.9.1
>>>
>>> I'm trying to upgrade our application from Lucene 2.4.1 to Lucene 2.9.1.
>>> I've been using an InstantiatedIndex to do a bunch of unit testing, but
>>> am
>>> running into a some problems with Lucene 2.9.1.
>>> In particular, when I try to run a MatchAllDocsQuery on my
>>> InstantiatedIndex
>>> (which worked fine on 2.4.1) a NullPointerException is raised.  I think I
>>> tracked down the problem in the Lucene source.
>>>
>>> In the 2.9.1 MatchAllDocsQuery, the MatchAllScorer retrieves termDocs
>>> from
>>> the IndexReader passed to it with
>>>
>>> reader.termDocs(null)
>>>
>>> which I assume is supposed to return all termDocs.  However, tracing this
>>> call down
>>>
>>> IndexReader.termDocs(term) calls InstantiatedTermDocs.seek(
>>> term) calls InstantiatedIndex.findTerm(term)
>>>
>>> which is implemented as
>>>
>>> InstantiatedTerm findTerm(Term term) {
>>>   return findTerm(term.field(), term.text());
>>> }
>>>
>>> which, since term is null, results in a NullPointerException.  This seems
>>> to
>>> me like an bug either in the MatchAllDocsQuery implementation (the
>>> version
>>> in 2.4.1 did not use termDocs, so did not pass through this null), or a
>>> bug
>>> in the implementation of InstantiatedIndex.
>>>
>>> Any suggestions on what I can do about this?  I definitely can't get rid
>>> of
>>> the MatchAllDocsQuery and don't really want to move back to a slow
>>> RAMDirectory.
>>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>

Re: MatchAllDocsQuery and InstantiatedIndex on Lucene 2.9.1

Posted by Karl Wettin <ka...@gmail.com>.
https://issues.apache.org/jira/browse/LUCENE-2144

9 dec 2009 kl. 23.22 skrev Uwe Schindler:

> This is a bug in InstantiatedIndex. The termDoc(null) was added to  
> get all
> documents. This was never implemented in Instantiated Index. Can you  
> open an
> issue?
>
> There maybe other queries fail because of this (e.g.
> FieldCacheRangeFilter,...).
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
>
>> -----Original Message-----
>> From: Jason Fennell [mailto:jdfennell@gmail.com]
>> Sent: Wednesday, December 09, 2009 7:48 PM
>> To: java-user@lucene.apache.org
>> Subject: MatchAllDocsQuery and InstantiatedIndex on Lucene 2.9.1
>>
>> I'm trying to upgrade our application from Lucene 2.4.1 to Lucene  
>> 2.9.1.
>> I've been using an InstantiatedIndex to do a bunch of unit testing,  
>> but am
>> running into a some problems with Lucene 2.9.1.
>> In particular, when I try to run a MatchAllDocsQuery on my
>> InstantiatedIndex
>> (which worked fine on 2.4.1) a NullPointerException is raised.  I  
>> think I
>> tracked down the problem in the Lucene source.
>>
>> In the 2.9.1 MatchAllDocsQuery, the MatchAllScorer retrieves  
>> termDocs from
>> the IndexReader passed to it with
>>
>> reader.termDocs(null)
>>
>> which I assume is supposed to return all termDocs.  However,  
>> tracing this
>> call down
>>
>> IndexReader.termDocs(term) calls InstantiatedTermDocs.seek(
>> term) calls InstantiatedIndex.findTerm(term)
>>
>> which is implemented as
>>
>> InstantiatedTerm findTerm(Term term) {
>>    return findTerm(term.field(), term.text());
>> }
>>
>> which, since term is null, results in a NullPointerException.  This  
>> seems
>> to
>> me like an bug either in the MatchAllDocsQuery implementation (the  
>> version
>> in 2.4.1 did not use termDocs, so did not pass through this null),  
>> or a
>> bug
>> in the implementation of InstantiatedIndex.
>>
>> Any suggestions on what I can do about this?  I definitely can't  
>> get rid
>> of
>> the MatchAllDocsQuery and don't really want to move back to a slow
>> RAMDirectory.
>
>
> ---------------------------------------------------------------------
> 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


RE: MatchAllDocsQuery and InstantiatedIndex on Lucene 2.9.1

Posted by Uwe Schindler <uw...@thetaphi.de>.
This is a bug in InstantiatedIndex. The termDoc(null) was added to get all
documents. This was never implemented in Instantiated Index. Can you open an
issue?

There maybe other queries fail because of this (e.g.
FieldCacheRangeFilter,...).

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de

> -----Original Message-----
> From: Jason Fennell [mailto:jdfennell@gmail.com]
> Sent: Wednesday, December 09, 2009 7:48 PM
> To: java-user@lucene.apache.org
> Subject: MatchAllDocsQuery and InstantiatedIndex on Lucene 2.9.1
> 
> I'm trying to upgrade our application from Lucene 2.4.1 to Lucene 2.9.1.
> I've been using an InstantiatedIndex to do a bunch of unit testing, but am
> running into a some problems with Lucene 2.9.1.
> In particular, when I try to run a MatchAllDocsQuery on my
> InstantiatedIndex
> (which worked fine on 2.4.1) a NullPointerException is raised.  I think I
> tracked down the problem in the Lucene source.
> 
> In the 2.9.1 MatchAllDocsQuery, the MatchAllScorer retrieves termDocs from
> the IndexReader passed to it with
> 
> reader.termDocs(null)
> 
> which I assume is supposed to return all termDocs.  However, tracing this
> call down
> 
> IndexReader.termDocs(term) calls InstantiatedTermDocs.seek(
> term) calls InstantiatedIndex.findTerm(term)
> 
> which is implemented as
> 
> InstantiatedTerm findTerm(Term term) {
>     return findTerm(term.field(), term.text());
> }
> 
> which, since term is null, results in a NullPointerException.  This seems
> to
> me like an bug either in the MatchAllDocsQuery implementation (the version
> in 2.4.1 did not use termDocs, so did not pass through this null), or a
> bug
> in the implementation of InstantiatedIndex.
> 
> Any suggestions on what I can do about this?  I definitely can't get rid
> of
> the MatchAllDocsQuery and don't really want to move back to a slow
> RAMDirectory.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org