[
https://issues.apache.org/jira/browse/LUCENE-6393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14395785#comment-14395785
]
Robert Muir commented on LUCENE-6393:
-------------------------------------
{quote}
Because of the Spans contract that there is always at least one start/end
position per doc, I considered adding a firstStartPosition method that should
be called before the first nextStartPosition call.
That would reduce the need for the atFirstInCurrentDoc flag that is used in
quite a few Spans, and that might help to avoid problems like this one.
{quote}
Well, I'm not sure it would avoid all cases of this problem, which IMO is a
trap in FilterSpans. If we return null in FilterSpans by default, thats also a
trap (just a performance trap instead).
Separately, it might be a good idea, but maybe we should add the remaining
two-phase support first (SpanOrQuery, SpanNotQuery) and then try to look at
refactoring after have a clear picture of all the stuff involved? I started
with this query because it seemed easiest. The next step would be to give
SpanOr and SpanNot logic similar to DisjunctionScorer and ReqExclScorer.
Another step after that is to see if they can share two-phase code (like
SpanNear does with ConjunctionDISI).
> SpanFirstQuery sometimes returns Spans without any positions
> ------------------------------------------------------------
>
> Key: LUCENE-6393
> URL: https://issues.apache.org/jira/browse/LUCENE-6393
> Project: Lucene - Core
> Issue Type: Bug
> Reporter: Robert Muir
> Fix For: Trunk, 5.2
>
> Attachments: LUCENE-6393-alternative.patch, LUCENE-6393.patch
>
>
> This hits an assert in SpanScorer because it breaks the javadocs contract of
> Spans.nextStartPosition():
> * Returns the next start position for the current doc.
> * There is always *at least one start/end position* per doc.
> * After the last start/end position at the current doc this returns
> NO_MORE_POSITIONS.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]