Get API: When _source is disabled, the source is still used if fetched from the transaction log, closes #1927.

This commit is contained in:
Shay Banon 2012-05-08 17:58:30 +03:00
parent ddecd723a7
commit 11064df6aa
1 changed files with 6 additions and 3 deletions

View File

@ -299,12 +299,15 @@ public class ShardGetService extends AbstractIndexShardComponent {
} }
FieldMapper<?> x = docMapper.mappers().smartNameFieldMapper(field); FieldMapper<?> x = docMapper.mappers().smartNameFieldMapper(field);
// only if the field is stored or source is enabled we should add it..
if (docMapper.sourceMapper().enabled() || x == null || x.stored()) {
value = searchLookup.source().extractValue(field); value = searchLookup.source().extractValue(field);
if (x != null && value instanceof String) { if (x != null && value instanceof String) {
value = x.valueFromString((String) value); value = x.valueFromString((String) value);
} }
} }
} }
}
if (value != null) { if (value != null) {
if (fields == null) { if (fields == null) {
fields = newHashMapWithExpectedSize(2); fields = newHashMapWithExpectedSize(2);