Check the bytes property:
http://lucene.apache.org/core/4_0_0/core/org/apache/lucene/util/BytesRef.html#bytes
@Override
public float scorePayload(int doc, int start, int end, BytesRef payload) {
if (payload != null) {
return PayloadHelper.decodeFloat(payload.bytes);
}
return 1.0f;
}
-----Original message-----
> From:michael.boom <[email protected]>
> Sent: Monday 13th January 2014 14:49
> To: [email protected]
> Subject: Re: Simple payloads example not working
>
> Thanks iorixxx,
>
> Actually I've just tried it and I hit a small wall, the tutorial looks not
> to be up to date with the codebase.
> When implementing my custom similarity class i should be using
> PayloadHelper, but following happens:
>
> in PayloadHelper:
> public static final float decodeFloat(byte [] bytes, int offset)
>
> in DefaultSimilarity:
> public float scorePayload(int doc, int start, int end, BytesRef payload)
>
> So it's BytesRef vs byte[].
> How should i proceed in this scenario?
>
>
>
> -----
> Thanks,
> Michael
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Simple-payloads-example-not-working-tp4110998p4111040.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>