Typically you would use a function query there to manipulate the score
rather than a constant of 2. This doesn't do much but simply multiply all
scores by that value. You can do something like boost=sqrt(popularity) if
you wanted to boost on the popularity field for example. In both cases,
however, the explain is still the same in that it's not showing the full
explain when applying a boost function (or constant number).

Wondering if I'm missing something here?

Ryan







On Wed, 25 Apr 2018 at 04:21 Nawab Zada Asad Iqbal <khi...@gmail.com> wrote:

> I didn't know you can add boosts like that (&boost=2 ). Are you boosting on
> a field or document by using that syntax?
>
> On Sun, Apr 22, 2018 at 10:51 PM, Ryan Yacyshyn <ryan.yacys...@gmail.com>
> wrote:
>
> > Hi all,
> >
> > When viewing the explain under debug=true in Solr 7.3.0 using
> > the edismax query parser with a boost, I only see the "boost" part of the
> > explain. Without applying a boost I see the full explain. Is this the
> > expected behaviour?
> >
> > Here's how to check using the techproducts example..
> >
> > bin/solr -e techproducts
> >
> > ```
> > http://localhost:8983/solr/techproducts/select?q={!
> > edismax}samsung&qf=name&debug=true
> > ```
> >
> > returns:
> >
> > ```
> > "debug": {
> >     "rawquerystring": "{!edismax}samsung",
> >     "querystring": "{!edismax}samsung",
> >     "parsedquery": "+DisjunctionMaxQuery((name:samsung))",
> >     "parsedquery_toString": "+(name:samsung)",
> >     "explain": {
> >       "SP2514N": "\n2.3669035 = weight(name:samsung in 1)
> > [SchemaSimilarity], result of:\n  2.3669035 = score(doc=1,freq=1.0 =
> > termFreq=1.0\n), product of:\n    2.6855774 = idf, computed as log(1 +
> > (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:\n      1.0 =
> docFreq\n
> >     21.0 = docCount\n    0.8813388 = tfNorm, computed as (freq * (k1 +
> 1))
> > / (freq + k1 * (1 - b + b * fieldLength / avgFieldLength)) from:\n
> 1.0
> > = termFreq=1.0\n      1.2 = parameter k1\n      0.75 = parameter b\n
> > 7.5238094 = avgFieldLength\n      10.0 = fieldLength\n"
> >     },
> >     "QParser": "ExtendedDismaxQParser",
> > ...
> > ```
> >
> > If I just add &boost=2 to this, I get this explain back:
> >
> > ```
> > "debug": {
> >     "rawquerystring": "{!edismax}samsung",
> >     "querystring": "{!edismax}samsung",
> >     "parsedquery":
> "FunctionScoreQuery(FunctionScoreQuery(+(name:samsung),
> > scored by boost(const(2))))",
> >     "parsedquery_toString": "FunctionScoreQuery(+(name:samsung), scored
> by
> > boost(const(2)))",
> >     "explain": {
> >       "SP2514N": "\n4.733807 = product of:\n  1.0 = boost\n  4.733807 =
> > boost(const(2))\n"
> >     },
> >     "QParser": "ExtendedDismaxQParser",
> > ...
> > ```
> >
> > Is this normal? I was expecting to see more like the first example, with
> > the addition of the boost applied.
> >
> > Thanks,
> > Ryan
> >
>

Reply via email to