Skip to content

Commit

Permalink
Get API: When _source is disabled, the source is still used if fetche…
Browse files Browse the repository at this point in the history
…d from the transaction log, closes #1927.
  • Loading branch information
kimchy committed May 8, 2012
1 parent ddecd72 commit 11064df
Showing 1 changed file with 6 additions and 3 deletions.
Expand Up @@ -299,9 +299,12 @@ public GetResult innerGet(String type, String id, String[] gFields, boolean real
}

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);
}
}
}
}
Expand Down

0 comments on commit 11064df

Please sign in to comment.