Thanks Hoss!
The approach that I explained in my subsequent email works like a charm.

Cheers
Avlesh

On Wed, Sep 30, 2009 at 3:45 AM, Chris Hostetter
<hossman_luc...@fucit.org>wrote:

>
> : The question was either non-trivial or heavily uninteresting! No replies
> yet
>
> it's pretty non-trivial, and pretty interesting, but i'm also pretty
> behind on my solr-user email.
>
> I don't think there's anyway to do what you wanted without a custom
> plugin, so your efforts weren't in vain ... if we add the abiliity to sort
> by a ValueSource (aka function ... there's a Jira issue for this
> somewhere) then you could also do witha combination of functions so that
> anything in your category gets flattened to an extremely high constant,
> and everything else has a real score -- then a secondary sort on a random
> field would effectively only randomize the things in your category ... but
> we're not there yet.
>
> : Hoss, I have a small question (RandomSortField bears your signature) -
> Any
> : reason as to why RandomSortField#hash() and RandomSortField#getSeed()
> : methods are private? Having them public would have saved myself from
> : "owning" a copy in my class as well.
>
> just a general principle of API future-proofing: keep internals private
> unless you explicitly think through how subclasses will use them.
>
> I haven't thought it through all the way, but do you really need to copy
> everything?  couldn't you get the SortField/Comparator from super and
> only delegate to it if the categories both match your specific categoryId?
>
>
>
> -Hoss
>
>

Reply via email to