Re: Behavior of Function Query

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Behavior of Function Query

Zheng Lin Edwin Yeo
Hi,

Which version of Solr are you running? How many shards/replica is this
running on, and are you running on SolrCloud?

Regards,
Edwin

On Mon, 18 Mar 2019 at 22:19, Ashish Bisht <[hidden email]> wrote:

> Please see the below requests and response
>
> http://Sol:8983/solr/SCSpell/select?q="*internet of
>
> things*"&defType=edismax&qf=spellcontent&wt=json&rows=1&fl=score,internet_of_things:query({!edismax
> v='"*internet of things*"'}),instant_of_things:query({!edismax v='"instant
> of things"'})
>
>
> Response contains score from function query
>
>      "fl":"score,internet_of_things:query({!edismax v='\"internet of
> things\"'}),instant_of_things:query({!edismax v='\"instant of things\"'})",
>       "rows":"1",
>       "wt":"json"}},
>   "response":{"numFound":851,"start":0,"maxScore":7.6176834,"docs":[
>       {
>         "score":7.6176834,
>        * "internet_of_things":7.6176834*}]
>   }}
>
>
> But if in the same request q is changed,it doesn't give score
>
> http://Sol-1:8983/solr/SCSpell/select?q="*wall
>
> street*"&defType=edismax&qf=spellcontent&wt=json&rows=1&fl=score,internet_of_things:query({!edismax
> v='"*internet of things*"'}),instant_of_things:query({!edismax v='"instant
> of things"'})
>
>    "q":"\"wall street\"",
>       "defType":"edismax",
>       "qf":"spellcontent",
>       "fl":"score,internet_of_things:query({!edismax v='\"internet of
> things\"'}),instant_of_things:query({!edismax v='\"instant of things\"'})",
>       "rows":"1",
>       "wt":"json"}},
>   "response":{"numFound":46,"start":0,"maxScore":15.670144,"docs":[
>       {
>         "score":15.670144}]
>   }}
>
>
> Why score of function query is getting applied when q is a different.
>
>
>
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
>
Reply | Threaded
Open this post in threaded view
|

Re: Behavior of Function Query

Erik Hatcher-4
Try adding fl=* into the request.   There’s an oddity with fl, iirc, where it can skip functions if * isn’t there (or maybe a concrete non-score field?)

   Erik

> On Mar 18, 2019, at 10:19, Ashish Bisht <[hidden email]> wrote:
>
> Please see the below requests and response
>
> http://Sol:8983/solr/SCSpell/select?q="*internet of
> things*"&defType=edismax&qf=spellcontent&wt=json&rows=1&fl=score,internet_of_things:query({!edismax
> v='"*internet of things*"'}),instant_of_things:query({!edismax v='"instant
> of things"'})
>
>
> Response contains score from function query
>
>     "fl":"score,internet_of_things:query({!edismax v='\"internet of
> things\"'}),instant_of_things:query({!edismax v='\"instant of things\"'})",
>      "rows":"1",
>      "wt":"json"}},
>  "response":{"numFound":851,"start":0,"maxScore":7.6176834,"docs":[
>      {
>        "score":7.6176834,
>       * "internet_of_things":7.6176834*}]
>  }}
>
>
> But if in the same request q is changed,it doesn't give score
>
> http://Sol-1:8983/solr/SCSpell/select?q="*wall
> street*"&defType=edismax&qf=spellcontent&wt=json&rows=1&fl=score,internet_of_things:query({!edismax
> v='"*internet of things*"'}),instant_of_things:query({!edismax v='"instant
> of things"'})
>
>   "q":"\"wall street\"",
>      "defType":"edismax",
>      "qf":"spellcontent",
>      "fl":"score,internet_of_things:query({!edismax v='\"internet of
> things\"'}),instant_of_things:query({!edismax v='\"instant of things\"'})",
>      "rows":"1",
>      "wt":"json"}},
>  "response":{"numFound":46,"start":0,"maxScore":15.670144,"docs":[
>      {
>        "score":15.670144}]
>  }}
>
>
> Why score of function query is getting applied when q is a different.
>
>
>
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Reply | Threaded
Open this post in threaded view
|

Re: Behavior of Function Query

Mikhail Khludnev-2
Ok. ValueSourceAugmenter.transform(SolrDocument, int) omits null values
coming from QueryDocValues.objectVal(int) on non-matching docs.
It might seems odd, but that's it.

On Tue, Mar 19, 2019 at 1:21 PM Erik Hatcher <[hidden email]> wrote:

> Try adding fl=* into the request.   There’s an oddity with fl, iirc, where
> it can skip functions if * isn’t there (or maybe a concrete non-score
> field?)
>
>    Erik
>
> > On Mar 18, 2019, at 10:19, Ashish Bisht <[hidden email]> wrote:
> >
> > Please see the below requests and response
> >
> > http://Sol:8983/solr/SCSpell/select?q="*internet of
> >
> things*"&defType=edismax&qf=spellcontent&wt=json&rows=1&fl=score,internet_of_things:query({!edismax
> > v='"*internet of things*"'}),instant_of_things:query({!edismax
> v='"instant
> > of things"'})
> >
> >
> > Response contains score from function query
> >
> >     "fl":"score,internet_of_things:query({!edismax v='\"internet of
> > things\"'}),instant_of_things:query({!edismax v='\"instant of
> things\"'})",
> >      "rows":"1",
> >      "wt":"json"}},
> >  "response":{"numFound":851,"start":0,"maxScore":7.6176834,"docs":[
> >      {
> >        "score":7.6176834,
> >       * "internet_of_things":7.6176834*}]
> >  }}
> >
> >
> > But if in the same request q is changed,it doesn't give score
> >
> > http://Sol-1:8983/solr/SCSpell/select?q="*wall
> >
> street*"&defType=edismax&qf=spellcontent&wt=json&rows=1&fl=score,internet_of_things:query({!edismax
> > v='"*internet of things*"'}),instant_of_things:query({!edismax
> v='"instant
> > of things"'})
> >
> >   "q":"\"wall street\"",
> >      "defType":"edismax",
> >      "qf":"spellcontent",
> >      "fl":"score,internet_of_things:query({!edismax v='\"internet of
> > things\"'}),instant_of_things:query({!edismax v='\"instant of
> things\"'})",
> >      "rows":"1",
> >      "wt":"json"}},
> >  "response":{"numFound":46,"start":0,"maxScore":15.670144,"docs":[
> >      {
> >        "score":15.670144}]
> >  }}
> >
> >
> > Why score of function query is getting applied when q is a different.
> >
> >
> >
> > --
> > Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
>


--
Sincerely yours
Mikhail Khludnev