From f1e23067cd641e27efcc0523161a3904b7d06ae3 Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Thu, 4 Aug 2011 22:34:33 +0300 Subject: [PATCH] Stored fields with multiple values might not return in search request asking for them, closes #1208. --- .../common/lucene/document/SingleFieldSelector.java | 2 +- .../index/mapper/selector/FieldMappersFieldSelector.java | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/common/lucene/document/SingleFieldSelector.java b/modules/elasticsearch/src/main/java/org/elasticsearch/common/lucene/document/SingleFieldSelector.java index 7338ca0df3b..7bdc930d1b3 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/common/lucene/document/SingleFieldSelector.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/common/lucene/document/SingleFieldSelector.java @@ -41,7 +41,7 @@ public class SingleFieldSelector implements ResetFieldSelector { @Override public FieldSelectorResult accept(String fieldName) { if (name.equals(fieldName)) { - return FieldSelectorResult.LOAD_AND_BREAK; + return FieldSelectorResult.LOAD; } return FieldSelectorResult.NO_LOAD; } diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/mapper/selector/FieldMappersFieldSelector.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/mapper/selector/FieldMappersFieldSelector.java index eaff64e04ab..d922a24b145 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/mapper/selector/FieldMappersFieldSelector.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/mapper/selector/FieldMappersFieldSelector.java @@ -32,8 +32,6 @@ import java.util.HashSet; public class FieldMappersFieldSelector implements ResetFieldSelector { private final HashSet names = new HashSet(); - private int count; - public void add(String fieldName) { names.add(fieldName); @@ -47,15 +45,11 @@ public class FieldMappersFieldSelector implements ResetFieldSelector { @Override public FieldSelectorResult accept(String fieldName) { if (names.contains(fieldName)) { - if (++count == names.size()) { - return FieldSelectorResult.LOAD_AND_BREAK; - } return FieldSelectorResult.LOAD; } return FieldSelectorResult.NO_LOAD; } @Override public void reset() { - count = 0; } }