[
https://issues.apache.org/jira/browse/LUCENE-6845?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14966707#comment-14966707
]
Alan Woodward commented on LUCENE-6845:
---------------------------------------
bq. What is the purpose of SpanNotQueryâs getSpanScorer wrapping the
includeSpans with a FilterSpans that has an accept that always returns YES?
This is a slightly hacky workaround for the fact that only the top-level Spans
implementation actually does any scoring. This means that degenerate cases
like single-clause SpanOrQueries or SpanNotQueries with null exclusion clauses
can't just return the relevant child Spans, because it won't have a SimScorer
set on it. Instead, we need to wrap it with a Spans containing a SimScorer.
This is an abuse of FilterSpans though - I'll create a specialised
ScoringWrapperSpans instead to use here.
If we're really worried about backwards compatibility, we could keep Spans as
an empty subclass of SpanScorer. But I really don't think it's necessary - we
already changed the Spans interface in 5.3 by adding Spans.collect(), so users
upgrading from 5.2 from 5.3 would have had to recompile.
> Merge Spans and SpanScorer
> --------------------------
>
> Key: LUCENE-6845
> URL: https://issues.apache.org/jira/browse/LUCENE-6845
> Project: Lucene - Core
> Issue Type: Improvement
> Reporter: Alan Woodward
> Assignee: Alan Woodward
> Fix For: Trunk, 5.4
>
> Attachments: LUCENE-6845.patch, LUCENE-6845_norenames.patch
>
>
> SpanScorer and Spans currently share the burden of scoring span queries, with
> SpanScorer delegating to Spans for most operations. Spans is essentially a
> Scorer, just with the ability to iterate through positions as well, and no
> SimScorer to use for scoring. This seems overly complicated. We should
> merge the two classes into one.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]