Thanks, that indeed fixed the problem.
Now i've created a custom Similarity class and used it in schema.xml.
Problem is now that for all docs the calculated payload score is the same:

public class CustomSolrSimilarity extends DefaultSimilarity {
    
    @Override
    public float scorePayload(int doc, int start, int end, BytesRef payload)
{
        if (payload != null) {
            Float pscore = PayloadHelper.decodeFloat(payload.bytes);
            System.out.println("payload is: " + payload.toString() + " with
score: " + Float.toString(pscore));
            return pscore;
        }
        return 1.0f;
    }
}


Output log:

payload is: [41 26 66 66] with score: 10.4
payload is: [41 f0 0 0] with score: 10.4
payload is: [42 4a cc cd] with score: 10.4
payload is: [42 c6 0 0] with score: 10.4
payload is: [41 26 66 66] with score: 10.4
payload is: [41 f0 0 0] with score: 10.4
payload is: [42 4a cc cd] with score: 10.4
payload is: [42 c6 0 0] with score: 10.4

Any idea why is it always the same ?




-----
Thanks,
Michael
--
View this message in context: 
http://lucene.472066.n3.nabble.com/Simple-payloads-example-not-working-tp4110998p4111045.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to