-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Labels
Description
Elasticsearch version: 5.0.0
Plugins installed: []
JVM version: 1.8
OS version: macOS 10.12.1
Description of the problem including expected versus actual behaviour:
InternalSearchHit.hasSource() seems to return incorrect values, and it's apparent why when you look at the source code:
@Override
public boolean hasSource() {
return source == null;
}
The SearchFieldsIT.testScriptDocAndFields() test also seems to be incorrect, expecting this wrong behaviour (since when specifying scripted fields, source is not returned unless explicitly requested) :
assertThat(response.getHits().getAt(0).hasSource(), equalTo(true));
Let me know if I've got this backwards, but I don't think so. At the very least if it's expected behaviour, the method name should change back to isSourceEmpty()