lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ryan Ernst (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (LUCENE-6256) PostingsEnum impls should respect documented behavior when no positions exist
Date Wed, 18 Feb 2015 20:56:12 GMT

     [ https://issues.apache.org/jira/browse/LUCENE-6256?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Ryan Ernst updated LUCENE-6256:
-------------------------------
    Description: {{PostingsEnum.nextPositions}} says that if no positions exist, NO_MORE_POSITIONS
will be returned on the first call (actually it refers to DocsEnum.NO_MORE_DOCS, which should
be changed since DocsEnum doesn't exist on trunk).  At least one impl (BlockDocsEnum) does
{{assert false}} inside {{nextPosition()}}.  This means if you have assertions turned on (e.g.
in a test) you get an assertion here, when the behavior should return NO_MORE_POSITIONS. 
I'm still going through all the implementations, but I also see {{MultiTermHighlighting}}
which returns {{Integer.MAX_VALUE}}.  I think we should clean up all these implementations
which have no positions (including maybe the fake scorers that are copied around in a lot
of places?) to return NO_MORE_POSITIONS.  (was: {{PostingsEnum.nextPositions}} says that if
no positions exist, NO_MORE_DOCS will be returned on the first call (actually it refers to
DocsEnum.NO_MORE_DOCS, which should be changed since DocsEnum doesn't exist on trunk).  At
least one impl (BlockDocsEnum) does {{assert false}} inside {{nextPosition()}}.  This means
if you have assertions turned on (e.g. in a test) you get an assertion here, when the behavior
should return NO_MORE_DOCS.  I'm still going through all the implementations, but I also see
{{MultiTermHighlighting}} which returns {{Integer.MAX_VALUE}}.  I think we should clean up
all these implementations which have no positions (including maybe the fake scorers that are
copied around in a lot of places?) to return NO_MORE_DOCS.)

> PostingsEnum impls should respect documented behavior when no positions exist
> -----------------------------------------------------------------------------
>
>                 Key: LUCENE-6256
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6256
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Ryan Ernst
>
> {{PostingsEnum.nextPositions}} says that if no positions exist, NO_MORE_POSITIONS will
be returned on the first call (actually it refers to DocsEnum.NO_MORE_DOCS, which should be
changed since DocsEnum doesn't exist on trunk).  At least one impl (BlockDocsEnum) does {{assert
false}} inside {{nextPosition()}}.  This means if you have assertions turned on (e.g. in a
test) you get an assertion here, when the behavior should return NO_MORE_POSITIONS.  I'm still
going through all the implementations, but I also see {{MultiTermHighlighting}} which returns
{{Integer.MAX_VALUE}}.  I think we should clean up all these implementations which have no
positions (including maybe the fake scorers that are copied around in a lot of places?) to
return NO_MORE_POSITIONS.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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


Mime
View raw message