I'm sorry for spoiling, but it's a fabulous FakeScorer pattern in Lucene.
e.g. look at
https://github.com/apache/lucene-solr/blob/trunk/lucene/grouping/src/java/org/apache/lucene/search/grouping/BlockGroupingCollector.java#L355
when your delegating collector is provided by scorer via setScorer(), it
shouldn't just pass it to the delegate as is, but pass a FakeScorer
instance instead (copy-paste your own and make it private, absolutely!),
which your collector can set docNum and application calculated score into
before delegating collect() notification. here is.

On Tue, Jan 27, 2015 at 12:30 AM, tedsolr <tsm...@sciquest.com> wrote:

> That's an interesting link Shawn. Especially since it mentions the
> possibility of sorting on pseudo-fields.
>
> My delegating collector computes the customs stats and stores them in the
> request context. I have a doc transformer that then grabs the stats for
> each
> doc and inserts the data in the output. Here's a sample return doc:
>
>      {
>         "ITEM_DESCRIPTION": "FREIGHT PAY AMT FOR ITEM - 30934014",
>         "SUPPLIER_NAME": "JESUS ACOSTA MORENO",
>         "GL_ACCOUNT_NAME": "-",
>         "PART_NUMBER": "-",
>         "MCC_CODE": "SDBHAULER.NA",
>         "[AggregationStats]": {
>           "count": 1,
>           "spend": 8402.39
>         }
>       },
>
> My stats are in the [AggregationStats] "field". I don't know if this
> qualifies as a pseudo-field. Sorting happens before my doc transformer is
> called, so I don't think this data is available for sort. Like you said,
> I'm
> not using a function query to create this data, so maybe this idea won't
> work.
>
> I'm going to try to use doc scoring. If I can make the score match my
> pseudo
> fields then it might work.
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Sorting-on-a-computed-value-tp4181875p4182060.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