When _source is disabled, don't return it in realtime get fetching the document from the transaction log, closes #1509.
This commit is contained in:
parent
e9fe8ec469
commit
b2fa6b7a94
|
@ -306,7 +306,7 @@ 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);
|
||||
value = x.valueFromString((String) value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -324,6 +324,11 @@ public class ShardGetService extends AbstractIndexShardComponent {
|
|||
}
|
||||
}
|
||||
|
||||
// if source is not enabled, don't return it even though we have it from the translog
|
||||
if (sourceRequested && !docMapper.sourceMapper().enabled()) {
|
||||
sourceRequested = false;
|
||||
}
|
||||
|
||||
return new GetResult(shardId.index().name(), type, id, get.version(), get.exists(), sourceRequested ? source.source : null, fields);
|
||||
}
|
||||
} finally {
|
||||
|
|
Loading…
Reference in New Issue