You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Cedric Ho <ce...@gmail.com> on 2008/04/02 09:15:53 UTC

SpanQuery scoring seems different

Hi all,

It seems that SpanNearQuery doesn't consider the boosting of the nested terms:

  1.3333334 = (MATCH) weight(spanNear([content2MBM:morgan^4.0,
content2MBM:stanley^4.0], 2, true) in 11976), product of:
    2.0 = queryWeight(spanNear([content2MBM:morgan^4.0,
content2MBM:stanley^4.0], 2, true)), product of:
      2.0 = idf(content2MBM: morgan=13 stanley=4)
      1.0 = queryNorm
    0.6666667 = (MATCH) fieldWeight(content2MBM:spanNear([morgan^4.0,
stanley^4.0], 2, true) in 11976), product of:
      0.33333334 = tf(phraseFreq=0.33333334)
      2.0 = idf(content2MBM: morgan=13 stanley=4)
      1.0 = fieldNorm(field=content2MBM, doc=11976)


with a BooleanQuery the boosting is included in the score calculation

    ....
    4.0 = (MATCH) weight(content2MBM:stanley^4.0 in 11976), product of:
      4.0 = queryWeight(content2MBM:stanley^4.0), product of:
        4.0 = boost                 /* This Line is what I want */
        1.0 = idf(docFreq=4, numDocs=45619)
        1.0 = queryNorm
      1.0 = (MATCH) fieldWeight(content2MBM:stanley in 11976), product of:
        1.0 = tf(termFreq(content2MBM:stanley)=1)
        1.0 = idf(docFreq=4, numDocs=45619)
        1.0 = fieldNorm(field=content2MBM, doc=11976)

I previously assume boost is calculated in all queries.
I am using 2.3.0.

Cedric

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


Re: SpanQuery scoring seems different

Posted by Cedric Ho <ce...@gmail.com>.
And I just found an old jira issue which might explain this behavior

LUCENE-533
http://www.archivum.info/java-dev@lucene.apache.org/2006-03/msg00265.html

Cedric


On Wed, Apr 2, 2008 at 3:15 PM, Cedric Ho <ce...@gmail.com> wrote:
> Hi all,
>
>  It seems that SpanNearQuery doesn't consider the boosting of the nested terms:
>
>   1.3333334 = (MATCH) weight(spanNear([content2MBM:morgan^4.0,
>  content2MBM:stanley^4.0], 2, true) in 11976), product of:
>     2.0 = queryWeight(spanNear([content2MBM:morgan^4.0,
>  content2MBM:stanley^4.0], 2, true)), product of:
>       2.0 = idf(content2MBM: morgan=13 stanley=4)
>       1.0 = queryNorm
>     0.6666667 = (MATCH) fieldWeight(content2MBM:spanNear([morgan^4.0,
>  stanley^4.0], 2, true) in 11976), product of:
>       0.33333334 = tf(phraseFreq=0.33333334)
>       2.0 = idf(content2MBM: morgan=13 stanley=4)
>       1.0 = fieldNorm(field=content2MBM, doc=11976)
>
>
>  with a BooleanQuery the boosting is included in the score calculation
>
>     ....
>     4.0 = (MATCH) weight(content2MBM:stanley^4.0 in 11976), product of:
>       4.0 = queryWeight(content2MBM:stanley^4.0), product of:
>         4.0 = boost                 /* This Line is what I want */
>         1.0 = idf(docFreq=4, numDocs=45619)
>         1.0 = queryNorm
>       1.0 = (MATCH) fieldWeight(content2MBM:stanley in 11976), product of:
>         1.0 = tf(termFreq(content2MBM:stanley)=1)
>         1.0 = idf(docFreq=4, numDocs=45619)
>         1.0 = fieldNorm(field=content2MBM, doc=11976)
>
>  I previously assume boost is calculated in all queries.
>  I am using 2.3.0.
>
>  Cedric
>

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