You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Mark Miller (JIRA)" <ji...@apache.org> on 2009/01/04 15:55:44 UTC

[jira] Commented: (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:comment-tabpanel&focusedCommentId=12660579#action_12660579 ] 

Mark Miller commented on LUCENE-533:
------------------------------------

Hoping we can get this one worked out Vincent. It is odd that the boost are ignored, and certainly seems incorrect to me.

I worked on a fix a few months ago, but unfortunately, things complicated fairly quickly, and I think you end up needing something similar to what BooleanQuery does to compute the tree boosts, which adds a lot of complication and could be a lot of performance loss (Span queries are already generally slower than standard queries).

Hope to get this resolved at some point in the future though, just not as simple as I would have hoped. Possibly why it was punted on to begin with.

> 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 - Java
>          Issue Type: Bug
>          Components: 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.
-
You can reply to this email to add a comment to the issue online.


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