[
https://issues.apache.org/jira/browse/LUCENE-8038?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16240170#comment-16240170
]
Nathan Gass commented on LUCENE-8038:
-------------------------------------
It might be feature creep for the current issue. But what is the story on
more complex custom payload functions?
To use PayloadScoreQuery, I necessarily have to decode the payload to a single
float and use that in the custom PayloadFunction. Lets say I have not only
floats as payloads but also for example token types. And my final scoring
factor could be for example the average of the most important type for which
the token in question exists. Currently I would need to do some dirty hacks
encoding type and score in a single float. But PayloadScoreQuery never actually
uses the value and just passes it on to the PayloadFunction. So if we deprecate
the old way anyway, the new one could be even more flexible?
That said that patch completely solves my current use case and the described
more complex one is a fabrication for the sake of an example.
> Decouple payload decoding from Similarity
> -----------------------------------------
>
> Key: LUCENE-8038
> URL: https://issues.apache.org/jira/browse/LUCENE-8038
> Project: Lucene - Core
> Issue Type: Improvement
> Reporter: Alan Woodward
> Assignee: Alan Woodward
> Attachments: LUCENE-8038-master.patch, LUCENE-8038.patch
>
>
> PayloadScoreQuery is the only place that currently uses
> SimScorer.computePayloadFactor(), and as discussed on LUCENE-8014, this seems
> like the wrong place for it. We should instead add a PayloadDecoder
> abstraction that is passed to PayloadScoreQuery.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]