#2831 Ensure score is finite before adding to API response in SearchHelper and DefaultSearcher.
This commit is contained in:
parent
bc55977e9d
commit
93354ce179
2 changed files with 8 additions and 2 deletions
|
@ -217,7 +217,10 @@ public class SearchHelper {
|
|||
}
|
||||
|
||||
if (!docMap.containsKey(Constants.SCORE)) {
|
||||
docMap.put(Constants.SCORE, hit.getScore());
|
||||
final float score = hit.getScore();
|
||||
if (Float.isFinite(score)) {
|
||||
docMap.put(Constants.SCORE, score);
|
||||
}
|
||||
}
|
||||
|
||||
docMap.put(fessConfig.getIndexFieldId(), hit.getId());
|
||||
|
|
|
@ -184,7 +184,10 @@ public class DefaultSearcher extends RankFusionSearcher {
|
|||
}
|
||||
|
||||
if (!docMap.containsKey(Constants.SCORE)) {
|
||||
docMap.put(Constants.SCORE, searchHit.getScore());
|
||||
final float score = searchHit.getScore();
|
||||
if (Float.isFinite(score)) {
|
||||
docMap.put(Constants.SCORE, score);
|
||||
}
|
||||
}
|
||||
|
||||
if (!docMap.containsKey(fessConfig.getIndexFieldId())) {
|
||||
|
|
Loading…
Add table
Reference in a new issue