You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Alan Woodward (JIRA)" <ji...@apache.org> on 2015/05/06 11:19:00 UTC

[jira] [Updated] (LUCENE-6466) Move SpanQuery.getSpans() to SpanWeight

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

Alan Woodward updated LUCENE-6466:
----------------------------------
    Attachment: LUCENE-6466.patch

Here is a patch.  SpanQuery.createWeight() is now final, and delegates on to an abstract method #createSpanWeight().  This takes an additional boolean parameter to determine whether or not the weight is at the top of a span tree, in which case it should build term stats.

Ideally I'd have liked to move SpanQuery.extractTerms() to SpanWeight as well, but that causes complications when collecting terms in the SpanWeight constructor (basically you can't call extractTerms on a delegate from a super constructor, because the delegate hasn't been set yet).

> Move SpanQuery.getSpans() to SpanWeight
> ---------------------------------------
>
>                 Key: LUCENE-6466
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6466
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Alan Woodward
>            Priority: Minor
>         Attachments: LUCENE-6466.patch
>
>
> SpanQuery.getSpans() should only be called on rewritten queries, so it seems to make more sense to have this being called from SpanWeight



--
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