DenseNumericDocValues corner case issue

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

DenseNumericDocValues corner case issue

John Wang-9
Hi folks:

We ran into a problem with DenseNumericDocValues in Lucene 8.0 codec where advanceExact returns true even when advancing to an invalid docid.

Our code looks like:

if (docval.advanceExact(docid)) {
    var myVal = docVal.get(docid);
}

when docid == DocIdSetIterator.NO_MORE_DOCS, the docVal.get() call barfs.

I am not sure if that is a bug in Lucene or is it the way I am calling the API.

Following is the link to the code for context. Any advice is appreciated.

https://github.com/apache/lucene-solr/blob/master/lucene/core/src/java/org/apache/lucene/codecs/lucene80/Lucene80DocValuesProducer.java#L413

Thanks

-John
Reply | Threaded
Open this post in threaded view
|

Re: DenseNumericDocValues corner case issue

Mikhail Khludnev-2
Hello, John.

Thanks.

On Wed, May 6, 2020 at 11:04 PM John Wang <[hidden email]> wrote:
Hi folks:

We ran into a problem with DenseNumericDocValues in Lucene 8.0 codec where advanceExact returns true even when advancing to an invalid docid.

Our code looks like:

if (docval.advanceExact(docid)) {
    var myVal = docVal.get(docid);
}

when docid == DocIdSetIterator.NO_MORE_DOCS, the docVal.get() call barfs.

I am not sure if that is a bug in Lucene or is it the way I am calling the API.

Following is the link to the code for context. Any advice is appreciated.

https://github.com/apache/lucene-solr/blob/master/lucene/core/src/java/org/apache/lucene/codecs/lucene80/Lucene80DocValuesProducer.java#L413

Thanks

-John


--
Sincerely yours
Mikhail Khludnev
Reply | Threaded
Open this post in threaded view
|

Re: DenseNumericDocValues corner case issue

John Wang-9
Ah, thank you Mikhail!

-John

On Wed, May 6, 2020 at 2:21 PM Mikhail Khludnev <[hidden email]> wrote:
Hello, John.

Thanks.

On Wed, May 6, 2020 at 11:04 PM John Wang <[hidden email]> wrote:
Hi folks:

We ran into a problem with DenseNumericDocValues in Lucene 8.0 codec where advanceExact returns true even when advancing to an invalid docid.

Our code looks like:

if (docval.advanceExact(docid)) {
    var myVal = docVal.get(docid);
}

when docid == DocIdSetIterator.NO_MORE_DOCS, the docVal.get() call barfs.

I am not sure if that is a bug in Lucene or is it the way I am calling the API.

Following is the link to the code for context. Any advice is appreciated.

https://github.com/apache/lucene-solr/blob/master/lucene/core/src/java/org/apache/lucene/codecs/lucene80/Lucene80DocValuesProducer.java#L413

Thanks

-John


--
Sincerely yours
Mikhail Khludnev