[
https://issues.apache.org/jira/browse/LUCENE-8424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16588244#comment-16588244
]
Tapan Vaishnav commented on LUCENE-8424:
----------------------------------------
Hello [~romseygeek],
Thanks for your reply.
{quote}apologies for the delay in responding, I've been away on holiday for the
past few weeks.
{quote}
No worries, apologies from my side too for tagging you while you were on
holidays.
{quote}Rather than deciding in the parent query what to do with null payloads,
instead we should allow consumers to decide this directly.
{quote}
It's only one example but if I understood correctly, handling _null_ exception
in _docscore_ function(Consumer).
[https://github.com/apache/lucene-solr/blob/branch_7_3/lucene/queries/src/java/org/apache/lucene/queries/payloads/MinPayloadFunction.java#L35]
{noformat}
@Override
public float docScore(int docId, String field, int numPayloadsSeen, float
payloadScore) {
return numPayloadsSeen > 0 ? (payloadScore >0 ? payloadScore : 1) : 1;
}{noformat}
{quote}'ll upload an example patch soonish which should explain what I mean.
{quote}
Got it, Thank you.
> Payload null value exception handling
> -------------------------------------
>
> Key: LUCENE-8424
> URL: https://issues.apache.org/jira/browse/LUCENE-8424
> Project: Lucene - Core
> Issue Type: Bug
> Affects Versions: 7.2, 7.3.1
> Reporter: Tapan Vaishnav
> Assignee: Alan Woodward
> Priority: Minor
> Attachments: LUCENE-8424.patch, LUCENE-8424.patch, LUCENE-8424.patch,
> LUCENE-8424.patch, LUCENE-8424.patch, LUCENE-8424.patch, LUCENE-8424.patch
>
>
> If-Condition to check payload null value in _PayloadScoreQuery.java_ was
> removed in LUCENE-8038. Because of that, regarding of the payload value,
> _payloadsSeen_ is always getting increment. This has compromised the overall
> score of the document(for instance, as payloadSeens is always greater than 0,
> docScore() in _MinPayloadFunction.java_ only returns payloadScore which can
> be zero depending on the payload value). Ideally, it should've returned 1 in
> case of _payload==null_.
> I have added a simple patch to get started, Please let me know if it needs
> any improvements.
> Thanks in advance.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]