add NaN handling for specific hit score as well

This commit is contained in:
kimchy 2010-07-17 13:52:31 +03:00
parent 1fccaf06e9
commit 6194b3ab0f
1 changed files with 5 additions and 1 deletions

View File

@ -226,7 +226,11 @@ public class InternalSearchHit implements SearchHit {
// builder.field("_node", shard.nodeId());
builder.field("_type", type());
builder.field("_id", id());
builder.field("_score", score);
if (Float.isNaN(score)) {
builder.nullField("_score");
} else {
builder.field("_score", score);
}
if (source() != null) {
if (XContentFactory.xContentType(source()) == builder.contentType()) {
builder.rawField("_source", source());