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

Robert Muir updated LUCENE-6394:
--------------------------------
    Attachment: LUCENE-6394.patch

Here is a patch. I think it simplifies SpanNot a great deal.

Basically we fold more logic from SpanPositionCheck into FilterSpans, and 
SpanNot uses that too.

Most methods in FilterSpans (nextDoc, nextStartPosition, two-phase support, 
etc) become final methods, it only has one abstract method:

{code}
/**
 * A {@link Spans} implementation wrapping another spans instance,
 * allowing to filter spans matches easily by implementing {@link #accept}
 */
public abstract class FilterSpans extends Spans {
...
  /** 
   * Returns YES if the candidate should be an accepted match,
   * NO if it should not, and NO_MORE_IN_CURRENT_DOC if iteration
   * should move on to the next document.
   */
  protected abstract AcceptStatus accept(Spans candidate) throws IOException;
{code}



> Add two-phase support to SpanNotQuery
> -------------------------------------
>
>                 Key: LUCENE-6394
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6394
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Robert Muir
>         Attachments: LUCENE-6394.patch
>
>
> This query is actually a lot like SpanPositionCheckQuery, except it checks 
> that each inclusion Spans does not come near the exclusion side.
> Two-phase iteration should just work the inclusion side, deferring positions 
> (the overlap checking against exclusion) until necessary.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to