: "mysearch" requesthandler(see following codes), I found that custom sort
: just effect on the current page when I got multiple page results, but the
: sort is expected when I sets the rows which contains  all the results. Does
: anybody know how to solve it or the reason?

I haven't familiarized myself with the lucene sort code in a while, and 
much of your custom sort code is greek to me, but this one method does 
jump out at me...


:             @Override
:             public int compareDocToValue(int arg0, Object arg1)
:                     throws IOException {
:                 // TODO Auto-generated method stub
:                 return 0;
:             }

...i'm pretty sure you need to implement that method correctly to get 
meaningful sort ordering.


FWIW: If i was in your place, and had an external REST service that 
provided me with the sort values to use for each doc's unique key, given a 
users unique id, my first inclination would not be to implement it as a 
custom SearchComponent.

My first inclination would be to implement it as a custom 
ValueSourceParser (returning a custom ValueSource), and then leverage the 
function query syntax in the sort (ie: "sort=myFunction(the_user_id) asc") 
... that should mean a lot less non-sort related code you have to write.  
(or if i was still using Solr 3.6.x, i might implement a special FieldType 
-- using RandomFiled as inspiration and then register it with a "UID__*" 
dynamicField so "sort=UID__the_user_id asc" called my REST service using 
'the_user_id' as input)



-Hoss

Reply via email to