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,9 +299,12 @@ public class ShardGetService extends AbstractIndexShardComponent {
}
FieldMapper<?> x = docMapper.mappers().smartNameFieldMapper(field);
value = searchLookup.source().extractValue(field);
if (x != null && value instanceof String) {
value = x.valueFromString((String) value);
// 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);
if (x != null && value instanceof String) {
value = x.valueFromString((String) value);
}
}
}
}