search - How can I exclude scores that equal 0 in a Solr function query and maintain the actual score? -



search - How can I exclude scores that equal 0 in a Solr function query and maintain the actual score? -

my goal round score grouping similar items , sort field (let's utilize cost example).

i'm able accomplish next query:

/select?deftype=func&q=rint(product(query({!v=the search term}),100))&fl=score,price&sort=score%20desc,price

however, query returns every document indexed in solr.

how can filter query items score of 0 excluded?

i've tried adding {!frange l=1} query kind of worked... made of scores equal 1. isn't because need show relevant results first.

thanks in advance help.

alex

i spent hours trying filter out values relevance score of 0. couldn't find straight forwards way this. ended accomplishing workaround assigns query function local param. phone call local param in both query ("q=") , filter query ("fq=").

example

let's have query like:

q={!func}sum(*your arguments*)

first, create function component own parameter:

q={!func}$localparam &localparam={!func}sum(*your arguments*)

now homecoming results scores between 1 , 10 add together filter query on localparam:

q={!func}$localparam &localparam={!func}sum(*your arguments*) &fq={!frange l=1 u=10 inclusive=true}$localparam

search solr

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -