Hello,

you can modify query params in prepare() before QueryComponent. You can set
sorting to score and turn your component to compute it based on params.
Just an oftop, literally sorting extension might be done via
FieldComparatorSource, which is described in LIA. this proper way, might
not suite for your problem.

On Tue, Jan 27, 2015 at 6:58 PM, tedsolr <tsm...@sciquest.com> wrote:

> Hi. I'm trying to sort on computed values that my QParserPlugin creates.
> I've
> found out that I can make it happen by adding a fake scorer to the
> delegates
> before collect() is called. The problem I have now is how to modify the
> sort
> field in mid stream?
>
> The user selects COUNT as a sort field, but of course that is not a real
> field. I can examine the SolrParams and see that COUNT is the sort field. I
> can use that info to build my document scores properly for the computed
> counts. But the search still sorts on COUNT (which produces an error of
> course).
>
> If I only had one computed value to worry about for sorting, I could change
> "COUNT" to "score" before the query request is initiated and all would be
> well. But I have 2 computed values - so I need to know which one was
> selected by the user.
>
> Will any of these ideas work?
> 1) Pass some dynamic data to my Plugin that will tell me what the user
> wants
> to sort on, and set sort=score in the search request?
> 2) Change the sort param within my plugin (from COUNT or SPEND to score)?
> (using Solr 4.9)
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Dynamically-change-sort-tp4182264.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics

<http://www.griddynamics.com>
<mkhlud...@griddynamics.com>

Reply via email to