Make highlighter check source enabled again instead of source complete...for now.
This commit is contained in:
parent
ac4942b5a7
commit
91aeea9c66
|
@ -86,8 +86,8 @@ public class HighlightPhase extends AbstractComponent implements FetchSubPhase {
|
|||
|
||||
if (context.highlight().forceSource(field)) {
|
||||
SourceFieldMapper sourceFieldMapper = context.mapperService().documentMapper(hitContext.hit().type()).sourceMapper();
|
||||
if (!sourceFieldMapper.isComplete()) {
|
||||
throw new IllegalArgumentException("source is forced for fields " + fieldNamesToHighlight + " but type [" + hitContext.hit().type() + "] has incomplete _source");
|
||||
if (!sourceFieldMapper.enabled()) {
|
||||
throw new IllegalArgumentException("source is forced for fields " + fieldNamesToHighlight + " but type [" + hitContext.hit().type() + "] has disabled _source");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -562,10 +562,9 @@ public class HighlighterSearchTests extends ElasticsearchIntegrationTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testForceSourceWithSourceDisabledBackcompat() throws Exception {
|
||||
public void testForceSourceWithSourceDisabled() throws Exception {
|
||||
|
||||
assertAcked(prepareCreate("test")
|
||||
.setSettings(IndexMetaData.SETTING_VERSION_CREATED, Version.V_1_4_2.id)
|
||||
.addMapping("type1", jsonBuilder().startObject().startObject("type1")
|
||||
.startObject("_source").field("enabled", false).endObject()
|
||||
.startObject("properties")
|
||||
|
|
Loading…
Reference in New Issue