@@ -0,0 +1,2191 @@
+package org.elasticsearch.index.mapper;%0A%0Aimport org.elasticsearch.common.compress.CompressedXContent;%0Aimport org.elasticsearch.common.settings.Settings;%0Aimport org.elasticsearch.common.xcontent.XContentBuilder;%0Aimport org.elasticsearch.index.MapperTestUtils;%0Aimport org.elasticsearch.test.ESTestCase;%0A%0Aimport java.io.IOException;%0A%0Aimport static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;%0Aimport static org.hamcrest.core.IsEqual.equalTo;%0A%0A/**%0A * Created by makeyang on 2016/12/8.%0A */%0Apublic class MultiFieldIncludeInAllMapperTests extends ESTestCase %7B%0A    public void testExceptionForCopyToInMultiFields() throws IOException %7B%0A        XContentBuilder mapping = createMappinmgWithIncludeInAllInMultiField();%0A%0A        // first check that for newer versions we throw exception if copy_to is found withing multi field%0A        MapperService mapperService = MapperTestUtils.newMapperService(createTempDir(), Settings.EMPTY);%0A        try %7B%0A            mapperService.parse(%22type%22, new CompressedXContent(mapping.string()), true);%0A            fail(%22Parsing should throw an exception because the mapping contains a include_in_all in a multi field%22);%0A        %7D catch (MapperParsingException e) %7B%0A            assertThat(e.getMessage(), equalTo(%22include_in_all in multi fields is not allowed. Found the include_in_all in field %5Bc%5D which is within a multi field.%22));%0A        %7D%0A    %7D%0A%0A    private static XContentBuilder createMappinmgWithIncludeInAllInMultiField() throws IOException %7B%0A        XContentBuilder mapping = jsonBuilder();%0A        mapping.startObject()%0A                .startObject(%22type%22)%0A                .startObject(%22properties%22)%0A                .startObject(%22a%22)%0A                .field(%22type%22, %22text%22)%0A                .endObject()%0A                .startObject(%22b%22)%0A                .field(%22type%22, %22text%22)%0A                .startObject(%22fields%22)%0A                .startObject(%22c%22)%0A                .field(%22type%22, %22text%22)%0A                .field(%22include_in_all%22, false)%0A                .endObject()%0A                .endObject()%0A                .endObject()%0A                .endObject()%0A                .endObject()%0A                .endObject();%0A        return mapping;%0A    %7D%0A%7D%0A

add test case for parse include_in_all in mulit fields