[ 
https://issues.apache.org/jira/browse/SOLR-4639?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jim Musil resolved SOLR-4639.
-----------------------------

    Resolution: Not A Problem

This turned out to be a simple issue in my custom code. Since 4.1, Payloads 
must now be scored with the offset.

Whereas, prior to 4.1 I could do this:

    @Override public float scorePayload(int doc, int start, int end, BytesRef 
payload)
    {
        // can ignore length here, because we know it is encoded as 4 bytes
        return PayloadHelper.decodeFloat(payload.bytes);
    }

I now must do this:

    @Override public float scorePayload(int doc, int start, int end, BytesRef 
payload)
    {
        // can ignore length here, because we know it is encoded as 4 bytes
        return PayloadHelper.decodeFloat(payload.bytes, payload.offset);
    }
                
> Payloads are not stored properly
> --------------------------------
>
>                 Key: SOLR-4639
>                 URL: https://issues.apache.org/jira/browse/SOLR-4639
>             Project: Solr
>          Issue Type: Bug
>          Components: contrib - DataImportHandler, update
>    Affects Versions: 4.1, 4.2
>         Environment: Linux ip-10-158-33-32 2.6.21.7-2.fc8xen #1 SMP Fri Feb 
> 15 12:34:28 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
>            Reporter: Jim Musil
>            Priority: Critical
>
> I'm seeing erratic behavior when attaching payloads to terms since 4.1. This 
> seems to coincide with a change in how payloads were stored within Lucene.
> I have a simple dynamic field *_ap that processes the field as a payload 
> field type as defined in the standard schema.xml.
> Using the update handler, if I send up the following documents:
>  [{"id":"1","foo_ap":"bar|50"}},{"id":"2","foo_ap":"bar|75"}] 
> The payload of "50" for term bar is used for BOTH documents.
> Additionally, if I upload the following:
>  [{"id":"1","foo_ap":"bar|50 bar|75 bar|100"}}]
> The payload of 50 is used in all three cases. I've verified this by creating 
> a custom CountPayloadFunction and SumPayloadFunction which shows that there 
> are indeed 3 payloads but the sum is 150.
> I've verified that everything works great in 4.0.
> There's some info about the core lucene change here:
> http://lucene.472066.n3.nabble.com/PayloadFunctions-don-t-work-the-same-since-4-1-tc4049947.html
> I use payloads extensively, so this is a real blocker for me.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to