Hi Dan,

It seems that you want a SearchComponent[1], something like the
QueryElevationComponent[2].
Take a look how at him and I think you can build your custom solution.

[1]-
http://lucene.apache.org/solr/api/org/apache/solr/handler/component/SearchComponent.html
[2]- http://wiki.apache.org/solr/QueryElevationComponent


Cheers,

-- Daniel Cassiano

http://dcassiano.wordpress.com


On Wed, May 19, 2010 at 6:46 AM, dan sutton <danbsut...@gmail.com> wrote:

> Hi,
>
> I have a requirement to do the following:
>
> For up to the first 10 results (i.e. only on the first page) show
> sponsored category ads, in order of bid, but no more than 2 / category,
> and only if all sponsored cat' ads are more that min% of the highest
> score. e.g. If I had the following:
>
> min% =1
>
>
> doc score bid  cat_id sponsored
>  1   100   x       x         0
>  2    55    x       x         0
>
>  3    50    2       2         1
>  4    20    2       2         1
>  5    05    2       2         1
>
>  6    80    1       1         1
>  7    70    1       1         1
>  8    60    1       1         1
>
> x = dont care
>
> sorted order would be:
>
> 3
> 4
>
> 6
> 7
>
> 1
> 8
> 2
> 5
>
> I'm not sure if this can be implemented with a custom comparator as I
> need access to the final score to enforce min%, I'm thinking I'm
> probably going to have to implement a subclass of QParserPlugin with a
> custom sort. but was wondering if there were alternatives ?
>
> Many thanks in advance.
> Dan
>

Reply via email to