: Chris, I was trying the below method for sorting the faceted buckets but 
: am seeing that the function query query($q) applies only to the score 
: from “q” parameter. My solr request has a combination of q, “bq” and 
: “bf” and it looks like the function query query($q) is calculating the 
: scores only on q and not on the aggregate score of q, bq and bf

right.  ok -- yeah, that makes sense.

The thing to udnerstand is that when you use request params as "variables" 
in functions like that, the function doesn't know the context of your 
request -- "query($q)" doesn't know/treat the "q" param special, it could 
just as easily be "query($make_up_a_param_name_thats_in_your_request)"

awhen when the query() function goes and evalutes the param you specify, 
it's not going to know that you have a defType of e/dismax that affects 
"q" param when the main query is executed -- it just parses it as a lucene 
query.

so what you need is something like "query({!dismax bf=$bf bq=$bq v=$q})" 
... i think that should work, or if not then use "query($facet_sort)" 
where facet_sort is a new param you add that contains "{!dismax bf=$bf 
bq=$bq v=$q}"

alternatively, you could change your "q" param to be very explicit about 
the query you want, w/o depending on defType, and use a custom param name 
for the original query string provided by the user -- that's what i 
frequently do...

   ie: q={!dismax bf=$bf bq=$bq v=$qq}&qq=dogs and cats

...and then the "query($q)" i suggested before should work as is.

does that make sense?


-Hoss
http://www.lucidworks.com/

Reply via email to