FAQ
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.

Search Discussions

  • Uwe Schindler at Dec 9, 2009 at 10:23 pm
    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
    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
  • Karl Wettin at Dec 10, 2009 at 8:20 pm
    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
    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
  • Jason Fennell at Dec 10, 2009 at 8:40 pm
    Thanks for the fast reply & patch!
    On Thu, Dec 10, 2009 at 12:20 PM, Karl Wettin 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
    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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedDec 9, '09 at 6:48p
activeDec 10, '09 at 8:40p
posts4
users3
websitelucene.apache.org

People

Translate

site design / logo © 2021 Grokbase