diff --git a/.idea/dictionaries/kimchy.xml b/.idea/dictionaries/kimchy.xml index 2e68051ff8e..174cd34a592 100644 --- a/.idea/dictionaries/kimchy.xml +++ b/.idea/dictionaries/kimchy.xml @@ -2,10 +2,12 @@ addr + amazonaws appendable args asciifolding attr + auth banon bindhost birthdate diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/search/internal/InternalSearchHits.java b/modules/elasticsearch/src/main/java/org/elasticsearch/search/internal/InternalSearchHits.java index 6079fbbb6a5..886c61749e5 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/search/internal/InternalSearchHits.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/search/internal/InternalSearchHits.java @@ -98,7 +98,11 @@ public class InternalSearchHits implements SearchHits { @Override public void toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject("hits"); builder.field("total", totalHits); - builder.field("max_score", maxScore); + if (Float.isNaN(maxScore)) { + builder.nullField("max_score"); + } else { + builder.field("max_score", maxScore); + } builder.field("hits"); builder.startArray(); for (SearchHit hit : hits) {