You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2021/07/28 14:45:00 UTC

[jira] [Commented] (LUCENE-9823) SynonymQuery rewrite can change field boost calculation

    [ https://issues.apache.org/jira/browse/LUCENE-9823?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17388814#comment-17388814 ] 

ASF subversion and git services commented on LUCENE-9823:
---------------------------------------------------------

Commit e31762253fcf7ef85fa0c09fdb40d3daf201a9d1 in lucene-solr's branch refs/heads/branch_8x from Julie Tibshirani
[ https://gitbox.apache.org/repos/asf?p=lucene-solr.git;h=e317622 ]

LUCENE-10039: Fix single-field scoring for CombinedFieldQuery (#2535)

When there's only one field, CombinedFieldQuery will ignore its weight while
scoring. This makes the scoring inconsistent, since the field weight is supposed
to multiply its term frequency.

This PR removes the optimizations around single-field scoring to make sure the
weight is always taken into account. These optimizations are not critical since
it should be uncommon to use CombinedFieldQuery with only one field.

This backport also incorporates the part of LUCENE-9823 that applies to
CombinedFieldQuery. We no longer rewrite single-field queries, which can also
change their scoring.

> SynonymQuery rewrite can change field boost calculation
> -------------------------------------------------------
>
>                 Key: LUCENE-9823
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9823
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Julie Tibshirani
>            Priority: Minor
>              Labels: newdev
>             Fix For: main (9.0)
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> SynonymQuery accepts a boost per term, which acts as a multiplier on the term frequency in the document. When rewriting a SynonymQuery with a single term, we create a BoostQuery wrapping a TermQuery. This changes the meaning of the boost: it now multiplies the final TermQuery score instead of multiplying the term frequency before it's passed to the score calculation.
> This is a small point, but maybe it's worth avoiding rewriting a single-term SynonymQuery unless the boost is 1.0.
> The same consideration affects CombinedFieldQuery in sandbox.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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