diff --git a/core/src/main/java/org/elasticsearch/index/query/SimpleQueryStringBuilder.java b/core/src/main/java/org/elasticsearch/index/query/SimpleQueryStringBuilder.java index 87f68cd0d92..65727d5dbcd 100644 --- a/core/src/main/java/org/elasticsearch/index/query/SimpleQueryStringBuilder.java +++ b/core/src/main/java/org/elasticsearch/index/query/SimpleQueryStringBuilder.java @@ -63,6 +63,8 @@ public class SimpleQueryStringBuilder extends AbstractQueryBuilder 0) { builder.startArray("fields"); for (Map.Entry entry : fieldsAndWeights.entrySet()) { - String field = entry.getKey(); - Float boost = entry.getValue(); - if (boost != null) { - builder.value(field + "^" + boost); - } else { - builder.value(field); - } + builder.value(entry.getKey() + "^" + entry.getValue()); } builder.endArray(); }