> First let me explain the logic behind here :) We have a
> list of "images" in
> a mySQL DB, which we are indexing (fine)
> 
> We have the following fields:
> 
> 1) description - a text field, separated by whitespace
> 2) keywords - a text field, separated by whitespace
> 3) download_count (a "sint", i.e sortable int)
> 
> What we are doing currently is:
> 
> (keywords:"st" AND keywords:"patricks") OR
> (description:"st" AND
> description:"patricks")
> 
> ...and then doing the "sort" with:
> 
>    score desc, download_count desc
> 
> The results work ok, but ideally we would like to give
> higher priority for
> those links that match the query, and then have a higher
> "download_count"
> value
> 
> For example, we have say 2 records:
> 
> Keywords:  st patricks some other keywords here
> Description: st irish holiday
> View Count: 54343
> 
> Keywords:  st patricks some other keywords here
> Description: st patricks  irish holiday
> View Count: 543
> 
> The 2nd record would currently show up higher for me, due
> to the fact we
> have "st patricks" in both the "keywords" and "description"
> fields... but
> what we ideally want, is for the "view count" to actually
> increase the
> ranking a bit more, to hopefully bring the results higher
> up
> 
> We've tried doing stuff like:
> 
> sort=download_count
> 
> ..but that doesn't do what we need (it simply sorts by the
> number of
> downloads, instead of giving a higher ranking based on the
> number of views)
> 
> I've had a look on google regarding this, but can't seem to
> find anything
> like the above.


People usually use BoostQParserPlugin, instead of directly sorting.

http://lucene.apache.org/solr/api/org/apache/solr/search/BoostQParserPlugin.html
 for this.

Replace &q={!boost b=download_count} in front of your original query.



Reply via email to