I have been able to create my custom field. The problem is that I have laoded
in the solr core a couple of HashMaps<id_doc,value_influence_sort> from a DB
with values that will influence in the sort. My problem is that I don't know
how to let my custom sort have access to this HashMaps.
I am a bit confused now. I think that would be easy to reach my goal using:

CustomSortComponent extends SearchComponent implements SolrCoreAware

This way, I would load the HashMaps in the "inform" method and would create
de custom sort using the HashMaps in the "preprare" method.

Don't know how to do that with the CustomField (similar to the
RandomField)... any advice?


Yonik Seeley-2 wrote:
> 
> The custom Field type similar to RandomSortField is definitely the way
> to go over a custom component since it's much less invasive - then
> everything else like distributed search should work.
> 
> But see SOLR-1111... I'm in the process of converting Solr to use the
> new FieldComparatorSource.
> 
> -Yonik
> http://www.lucidimagination.com
> 
> 
> 
> On Tue, May 26, 2009 at 9:25 AM, Marc Sturlese <marc.sturl...@gmail.com>
> wrote:
>>
>> Hey there,
>>
>> I want to implement a custom sort coding my own SortComparatorSource. The
>> sorter would sort the results doing some calculations of some document
>> attributes witch I have loaded previously from a DB at the solr core
>> init. I
>> mean, I have a preloaded hash with some attributes per doc id and I want
>> to
>> use them to implement the sorting.
>> I have considered two options:
>>
>> First would be to implement a custom field similar to the solr
>> RandomSortField and when search requests are done I would tell solr to
>> sort
>> using this custom field.
>>
>> The other option would be to plug a component (wich would extend from
>> SearchComponent) and do the custom sort in the prepare method.
>>
>> Any advice witch is the most optimal way to do that?
>>
>> Thanks in advance.
>> --
>> View this message in context:
>> http://www.nabble.com/Custom-sort-tp23722921p23722921.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Custom-sort-tp23722921p23783579.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to