I'm not sure your problem relates to the function or getting payload itslef.
But after 4.1, in DefaultSimilarity.scorePayload(int doc, int start, int end, BytesRef payload), you must leverage payload.offset and payload.length to get the bytes. (start and end won't get the exact bytes you want). Hope this help. Best regards, Duke If not now, when? If not me, who? On Fri, Mar 22, 2013 at 12:47 PM, jimtronic <jimtro...@gmail.com> wrote: > I have some custom Payload Functions that worked great up until version 4.1 > and now I can't get any of them to work correctly. In fact, the existing > ones -- AveragePayloadFunction, MaxPayloadFunction, and MinPayloadFunction > don't seem to work properly either. > > This may be a problem in Solr, but since this sort of straddles both > projects, I thought I would ask here. > > Originally I had followed this page: > http://sujitpal.blogspot.com/2011/01/payloads-with-solr.html > > In my tests, I have the following two documents and a custom query plugin > that should average the payload of the term bing and use that as the score: > > "docs":[ > { > "id":"3", > "foo_ap":["bing|9","bing|7"], > "score":9.0}, > { > "id":"1", > "foo_ap":["bing|9 bing|7","badda|9 bing|7"], > "score":9.0}, > ] > > Using 4.0, I get these results: > > "docs":[ > { > "id":"1", > "foo_ap":["bing|9 bing|7","badda|9 bing|7"], > "score":7.6666665}, > { > "id":"3", > "foo_ap":["bing|9","bing|7"], > "score":8.0} > ] > > Is it possible that something with the new 4.1 Codec would have changed how > payloads work? > > I'm eager to get these working again, but don't see anything in the > documentation that would indicate I need to be doing something different. > > Thanks for any help! > Jim > > > > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/PayloadFunctions-don-t-work-the-same-since-4-1-tp4049947.html > Sent from the Lucene - Java Users mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > >