From c2c4742f6543991dc06f106b45d96f3a03eb4e7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Carvalho?= Date: Mon, 24 Aug 2015 10:02:18 -0300 Subject: [PATCH] proper creation of values for unmapped field on score function --- .../common/lucene/search/function/FieldValueFactorFunction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/elasticsearch/common/lucene/search/function/FieldValueFactorFunction.java b/core/src/main/java/org/elasticsearch/common/lucene/search/function/FieldValueFactorFunction.java index 38c2cc98a2e..cb2babb574f 100644 --- a/core/src/main/java/org/elasticsearch/common/lucene/search/function/FieldValueFactorFunction.java +++ b/core/src/main/java/org/elasticsearch/common/lucene/search/function/FieldValueFactorFunction.java @@ -57,7 +57,7 @@ public class FieldValueFactorFunction extends ScoreFunction { public LeafScoreFunction getLeafScoreFunction(LeafReaderContext ctx) { final SortedNumericDoubleValues values; if(indexFieldData == null) { - values = FieldData.emptySortedNumericDoubles(0); + values = FieldData.emptySortedNumericDoubles(ctx.reader().maxDoc()); } else { values = this.indexFieldData.load(ctx).getDoubleValues(); }