You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Erick Erickson (JIRA)" <ji...@apache.org> on 2013/04/13 23:18:15 UTC

[jira] [Resolved] (LUCENE-533) SpanQuery scoring: SpanWeight lacks a recursive traversal of the query tree

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

Erick Erickson resolved LUCENE-533.
-----------------------------------

    Resolution: Fixed

SPRING_CLEANING_2013 JIRAS. Spans is an abstract class, suspect this is already done.
                
> SpanQuery scoring: SpanWeight lacks a recursive traversal of the query tree
> ---------------------------------------------------------------------------
>
>                 Key: LUCENE-533
>                 URL: https://issues.apache.org/jira/browse/LUCENE-533
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/search
>    Affects Versions: 1.9
>            Reporter: Vincent Le Maout
>            Priority: Minor
>
> I found the computing of weights to be somewhat different according to the query type (BooleanQuery versus SpanQuery) :
> org.apache.lucene.search.BooleanQuery.BooleanWeight :
> public BooleanWeight(Searcher searcher)
>      throws IOException {
>      this.similarity = getSimilarity(searcher);
>      for (int i = 0 ; i < clauses.size(); i++) {
>        BooleanClause c = (BooleanClause)clauses.elementAt(i);
>        weights.add(c.getQuery().createWeight(searcher));
>      }
>    }
> which looks like a recursive descent through the tree, taking into account the weights of all the nodes, whereas :
> org.apache.lucene.search.spans.SpanWeight :
> public SpanWeight(SpanQuery query, Searcher searcher)
>    throws IOException {
>    this.similarity = query.getSimilarity(searcher);
>    this.query = query;
>    this.terms = query.getTerms();
>    idf = this.query.getSimilarity(searcher).idf(terms, searcher);
>  }
> lacks any traversal and according to what I have understood so far from the rest
> of the code, only takes into account the boost of the tree root in SumOfSquareWeights(),
> which is consistent with the resulting scores not considering the boost of the tree
> leaves.
> vintz

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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