Ejemplo n.º 1
0
 protected internal virtual void ProcessPayload(Similarity similarity)
 {
     if (TermSpans.PayloadAvailable)
     {
         DocsAndPositionsEnum postings = TermSpans.Postings;
         Payload = postings.Payload;
         if (Payload != null)
         {
             PayloadScore_Renamed = OuterInstance.OuterInstance.Function.CurrentScore(Doc, OuterInstance.OuterInstance.Term.Field, Spans.Start(), Spans.End(), PayloadsSeen, PayloadScore_Renamed, DocScorer.ComputePayloadFactor(Doc, Spans.Start(), Spans.End(), Payload));
         }
         else
         {
             PayloadScore_Renamed = OuterInstance.OuterInstance.Function.CurrentScore(Doc, OuterInstance.OuterInstance.Term.Field, Spans.Start(), Spans.End(), PayloadsSeen, PayloadScore_Renamed, 1F);
         }
         PayloadsSeen++;
     }
     else
     {
         // zero out the payload?
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// By default, uses the <seealso cref="PayloadFunction"/> to score the payloads, but
 /// can be overridden to do other things.
 /// </summary>
 /// <param name="payLoads"> The payloads </param>
 /// <param name="start"> The start position of the span being scored </param>
 /// <param name="end"> The end position of the span being scored
 /// </param>
 /// <seealso cref= Spans </seealso>
 protected internal virtual void ProcessPayloads(ICollection <byte[]> payLoads, int start, int end)
 {
     foreach (var thePayload in payLoads)
     {
         Scratch.Bytes  = thePayload;
         Scratch.Offset = 0;
         Scratch.Length = thePayload.Length;
         PayloadScore   = OuterInstance.Function.CurrentScore(Doc, OuterInstance.FieldName, start, end, PayloadsSeen, PayloadScore, DocScorer.ComputePayloadFactor(Doc, Spans.Start(), Spans.End(), Scratch));
         ++PayloadsSeen;
     }
 }