Examples of sourceMapper()


Examples of org.elasticsearch.index.mapper.DocumentMapper.sourceMapper()

                .startObject("_source").field("enabled", false).endObject()
                .endObject().endObject().string();

        DocumentMapper mapper = MapperTests.newParser().parse("my_type", null, defaultMapping);
        assertThat(mapper.type(), equalTo("my_type"));
        assertThat(mapper.sourceMapper().enabled(), equalTo(false));

        try {
            mapper = MapperTests.newParser().parse(null, null, defaultMapping);
            assertThat(mapper.type(), equalTo("my_type"));
            assertThat(mapper.sourceMapper().enabled(), equalTo(false));
View Full Code Here

Examples of org.elasticsearch.index.mapper.DocumentMapper.sourceMapper()

        assertThat(mapper.sourceMapper().enabled(), equalTo(false));

        try {
            mapper = MapperTests.newParser().parse(null, null, defaultMapping);
            assertThat(mapper.type(), equalTo("my_type"));
            assertThat(mapper.sourceMapper().enabled(), equalTo(false));
            assert false;
        } catch (MapperParsingException e) {
            // all is well
        }
    }
View Full Code Here

Examples of org.elasticsearch.index.mapper.DocumentMapper.sourceMapper()

                .startObject("_source").field("enabled", true).endObject()
                .endObject().endObject().string();

        DocumentMapper mapper = MapperTests.newParser().parse("my_type", mapping, defaultMapping);
        assertThat(mapper.type(), equalTo("my_type"));
        assertThat(mapper.sourceMapper().enabled(), equalTo(true));
    }

    @Test public void testDefaultMappingAndNoMappingWithMapperService() throws Exception {
        String defaultMapping = XContentFactory.jsonBuilder().startObject().startObject(MapperService.DEFAULT_MAPPING)
                .startObject("_source").field("enabled", false).endObject()
View Full Code Here

Examples of org.elasticsearch.index.mapper.DocumentMapper.sourceMapper()

        MapperService mapperService = MapperTests.newMapperService();
        mapperService.add(MapperService.DEFAULT_MAPPING, defaultMapping);

        DocumentMapper mapper = (DocumentMapper) mapperService.documentMapperWithAutoCreate("my_type");
        assertThat(mapper.type(), equalTo("my_type"));
        assertThat(mapper.sourceMapper().enabled(), equalTo(false));
    }

    @Test public void testDefaultMappingAndWithMappingOverrideWithMapperService() throws Exception {
        String defaultMapping = XContentFactory.jsonBuilder().startObject().startObject(MapperService.DEFAULT_MAPPING)
                .startObject("_source").field("enabled", false).endObject()
View Full Code Here

Examples of org.elasticsearch.index.mapper.DocumentMapper.sourceMapper()

                .endObject().endObject().string();
        mapperService.add("my_type", mapping);

        DocumentMapper mapper = (DocumentMapper) mapperService.documentMapper("my_type");
        assertThat(mapper.type(), equalTo("my_type"));
        assertThat(mapper.sourceMapper().enabled(), equalTo(true));
    }
}
View Full Code Here

Examples of org.elasticsearch.index.mapper.DocumentMapper.sourceMapper()

                .startObject("_source").field("enabled", false).endObject()
                .endObject().endObject().string();

        DocumentMapper mapper = MapperTests.newParser().parse("my_type", mapping);
        assertThat(mapper.type(), equalTo("my_type"));
        assertThat(mapper.sourceMapper().enabled(), equalTo(false));

        mapper = MapperTests.newParser().parse(mapping);
        assertThat(mapper.type(), equalTo("type"));
        assertThat(mapper.sourceMapper().enabled(), equalTo(false));
    }
View Full Code Here

Examples of org.elasticsearch.index.mapper.DocumentMapper.sourceMapper()

        assertThat(mapper.type(), equalTo("my_type"));
        assertThat(mapper.sourceMapper().enabled(), equalTo(false));

        mapper = MapperTests.newParser().parse(mapping);
        assertThat(mapper.type(), equalTo("type"));
        assertThat(mapper.sourceMapper().enabled(), equalTo(false));
    }
}
View Full Code Here

Examples of org.elasticsearch.index.mapper.DocumentMapper.sourceMapper()

                .startObject("_source").field("enabled", false).endObject()
                .endObject().endObject().string();

        DocumentMapper mapper = MapperTests.newParser().parse("type", mapping);
        assertThat(mapper.type(), equalTo("type"));
        assertThat(mapper.sourceMapper().enabled(), equalTo(false));

        mapper = MapperTests.newParser().parse(mapping);
        assertThat(mapper.type(), equalTo("type"));
        assertThat(mapper.sourceMapper().enabled(), equalTo(false));
    }
View Full Code Here

Examples of org.elasticsearch.index.mapper.DocumentMapper.sourceMapper()

        assertThat(mapper.type(), equalTo("type"));
        assertThat(mapper.sourceMapper().enabled(), equalTo(false));

        mapper = MapperTests.newParser().parse(mapping);
        assertThat(mapper.type(), equalTo("type"));
        assertThat(mapper.sourceMapper().enabled(), equalTo(false));
    }
}
View Full Code Here

Examples of org.elasticsearch.index.mapper.DocumentMapper.sourceMapper()

                .endObject().endObject().string();

        DocumentMapperParser parser = createIndex("test").mapperService().documentMapperParser();
        DocumentMapper mapper = parser.parse("type", mapping);
        assertThat(mapper.type(), equalTo("type"));
        assertThat(mapper.sourceMapper().enabled(), equalTo(false));

        mapper = parser.parse(mapping);
        assertThat(mapper.type(), equalTo("type"));
        assertThat(mapper.sourceMapper().enabled(), equalTo(false));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.