19 using System.Collections.Generic;
22 using Lucene.Net.Index;
24 namespace Lucene.Net.Search.Function
74 public virtual float CustomScore(
int doc,
float subQueryScore,
float[] valSrcScores)
76 if (valSrcScores.Length == 1)
78 return CustomScore(doc, subQueryScore, valSrcScores[0]);
80 if (valSrcScores.Length == 0)
82 return CustomScore(doc, subQueryScore, 1);
84 float score = subQueryScore;
85 for (
int i = 0; i < valSrcScores.Length; i++)
87 score *= valSrcScores[i];
111 public virtual float CustomScore(
int doc,
float subQueryScore,
float valSrcScore)
113 return subQueryScore * valSrcScore;
128 if (valSrcExpls.Length == 1)
130 return CustomExplain(doc, subQueryExpl, valSrcExpls[0]);
132 if (valSrcExpls.Length == 0)
136 float valSrcScore = 1;
137 for (
int i = 0; i < valSrcExpls.Length; i++)
139 valSrcScore *= valSrcExpls[i].
Value;
143 for (
int i = 0; i < valSrcExpls.Length; i++)
163 float valSrcScore = 1;
164 if (valSrcExpl != null)
166 valSrcScore *= valSrcExpl.
Value;