Examples of documentMapperWithAutoCreate()


Examples of org.elasticsearch.index.mapper.MapperService.documentMapperWithAutoCreate()

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

        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 {
View Full Code Here

Examples of org.elasticsearch.index.mapper.MapperService.documentMapperWithAutoCreate()

                        if (doc != null) {
                            throw new ElasticsearchParseException("Either specify doc or get, not both");
                        }

                        MapperService mapperService = documentIndexService.mapperService();
                        Tuple<DocumentMapper, Boolean> docMapper = mapperService.documentMapperWithAutoCreate(request.documentType());
                        doc = docMapper.v1().parse(source(parser).type(request.documentType()).flyweight(true)).setMappingsModified(docMapper);
                        if (doc.mappingsModified()) {
                            mappingUpdatedAction.updateMappingOnMaster(request.shardId().getIndex(), docMapper.v1(), documentIndexService.indexUUID());
                        }
                        // the document parsing exists the "doc" object, so we need to set the new current field.
View Full Code Here

Examples of org.elasticsearch.index.mapper.MapperService.documentMapperWithAutoCreate()

        ParsedDocument doc = null;
        XContentParser parser = null;
        try {
            parser = XContentFactory.xContent(fetchedDoc).createParser(fetchedDoc);
            MapperService mapperService = documentIndexService.mapperService();
            Tuple<DocumentMapper, Boolean> docMapper = mapperService.documentMapperWithAutoCreate(type);
            doc = docMapper.v1().parse(source(parser).type(type).flyweight(true));

            if (context.highlight() != null) {
                doc.setSource(fetchedDoc);
            }
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.