lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Rosen <p...@performantsoftware.com>
Subject Re: de-boosting certain facets during search
Date Mon, 09 Nov 2009 23:28:01 GMT
I'm still going around in a circle on this. I'm not sure why it's not 
sinking in...

If I could just create the desired URL, I can probably work backwards 
and construct the correct ruby call.

Here is the URL that I'm currently creating (I've added newlines here 
for readability):

http://localhost:8983/solr/resources/select?hl.fragsize=600
&hl=true
&facet.field=genre
&facet.field=archive
&facet.limit=-1
&qt=standard
&start=0
&fq=archive%3A%22blake%22
&hl.fl=text
&fl=uri%2Carchive%2Cdate_label%2Cgenre
&facet=true
&q=%28history%29
&rows=60
&facet.missing=true
&facet.mincount=1

What this search returns from my index is 53 hits. The first 43 contain 
the genre field value "Citation" and the last 10 do not (they contain 
other values in that field.)

Note: the genre field is multivalued, if that matters.

I'd like the search to put all of the objects that contain genre 
"Citation" below the 10 objects that do not contain that genre.

I've read the various pages on boosting, but since I'm not actively 
searching on the field that I want to put a boost value on, I'm not sure 
how to go about this.

Thanks for any hints.

Paul Rosen wrote:
> Hi,
> 
> I'm using solr-ruby-0.0.8 and solr 1.4.
> 
> My data contains a faceted field called "genre". We would like one 
> particular genre, (the one named "Citation") to show up last in the 
> results.
> 
> I'm having trouble figuring out how to add the boost parameter to the 
> solr-ruby call. Here is my code:
> 
> req = Solr::Request::Standard.new(:start => start,
>   :rows => max,
>   :sort => sort_param,
>   :query => query,
>   :filter_queries => filter_queries,
>   :field_list => @field_list,
>   :facets => {:fields => @facet_fields,
>     :mincount => 1,
>     :missing => true,
>     :limit => -1},
>   :highlighting => {:field_list => ['text'],
>     :fragment_size => 600},
>     :shards => @cores)
> 
> response = @solr.send(req)
> 
> Do I just format it inside my query, like this:
> 
> query = query + "AND genre:Citation^.01"
> 
> or in filter_query, like this:
> 
> filter_queries.push("genre:Citation^.01")
> 
> or is there a hash parameter that I set?
> 
> (Note that the user can select Citation explicitly. I'll probably 
> special case that.)
> 
> I've tried variations of the above, but I've had no luck so far.
> 
> Thanks,
> Paul


Mime
View raw message