lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: Fixed first hits -> custom RequestHandler?
Date Fri, 22 Sep 2006 00:41:41 GMT

: On 9/21/06, Otis Gospodnetic <otis_gospodnetic@yahoo.com> wrote:
: > I have a situation where I want certain documents to appear at the top
: of the hit list for certain searches, regardless of their score.  One
: can think of it as the ads right on top of Google's search results (but
: I'm not dealing with ads).

the kind of approach Yonik described works well when you really want the
"boosted" documents (ie: ads, promoted products, etc) to be inlcuded in
the main paginated flow of results, regardless of how many there are.

if you want them to be broken out (like the ads google shows in the right
nav of their pages) so that they aren't affected by pagination or sorting
changes; or if you want a limited number to appear (ie: bubble the 3
highest scoring promoted products up to the top, but leave the rest of the
promoted products where they are in the normally sorted list) then i don't
know any way arround this except executing two searches.

I've typically done it by making two Solr requests from the client, but
you could also do this will a custom request handler that included two
DocLists in the results.

(now that you can progromatically modify/override the params of a
SolrQueryRequest, it would be really easy to write a subclass of any
existing request handler that first did the "promo" search, and then
delegated to the super class with "fq" params telling it to ignore the
results you've already included)



-Hoss


Mime
View raw message