Examples of uidMapper()


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

        return index.parsedDoc();
    }

    @Override public Engine.Delete prepareDelete(String type, String id, long version) throws ElasticSearchException {
        DocumentMapper docMapper = mapperService.documentMapperWithAutoCreate(type);
        return new Engine.Delete(type, id, docMapper.uidMapper().term(type, id)).version(version);
    }

    @Override public void delete(Engine.Delete delete) throws ElasticSearchException {
        writeAllowed();
        if (listeners != null) {
View Full Code Here

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

    }

    @Override public Engine.Create prepareCreate(SourceToParse source) throws ElasticSearchException {
        DocumentMapper docMapper = mapperService.documentMapperWithAutoCreate(source.type());
        ParsedDocument doc = docMapper.parse(source);
        return new Engine.Create(docMapper, docMapper.uidMapper().term(doc.uid()), doc);
    }

    @Override public ParsedDocument create(Engine.Create create) throws ElasticSearchException {
        writeAllowed();
        if (listeners != null) {
View Full Code Here

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

    }

    @Override public Engine.Index prepareIndex(SourceToParse source) throws ElasticSearchException {
        DocumentMapper docMapper = mapperService.documentMapperWithAutoCreate(source.type());
        ParsedDocument doc = docMapper.parse(source);
        return new Engine.Index(docMapper, docMapper.uidMapper().term(doc.uid()), doc);
    }

    @Override public ParsedDocument index(Engine.Index index) throws ElasticSearchException {
        writeAllowed();
        if (listeners != null) {
View Full Code Here

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

                        listener.onFailure(new ElasticSearchException("No fields found to fetch the 'likeText' from"));
                        return;
                    }

                    // exclude myself
                    Term uidTerm = docMapper.uidMapper().term(request.type(), request.id());
                    boolBuilder.mustNot(termQuery(uidTerm.field(), uidTerm.text()));
                } catch (Exception e) {
                    listener.onFailure(e);
                    return;
                }
View Full Code Here

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

        assertThat((String) docMapper.meta().get("param1"), equalTo("value1"));

        byte[] json = copyToBytesFromClasspath("/org/elasticsearch/index/mapper/simple/test1.json");
        Document doc = docMapper.parse(json).rootDoc();
        assertThat(doc.get(docMapper.uidMapper().names().indexName()), equalTo(Uid.createUid("person", "1")));
        assertThat((double) doc.getBoost(), closeTo(3.7, 0.01));
        assertThat(doc.get(docMapper.mappers().name("first").mapper().names().indexName()), equalTo("shay"));
//        System.out.println("Document: " + doc);
//        System.out.println("Json: " + docMapper.sourceMapper().value(doc));
    }
View Full Code Here

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

    @Test public void testSimpleParserNoTypeNoId() throws Exception {
        String mapping = copyToStringFromClasspath("/org/elasticsearch/index/mapper/simple/test-mapping.json");
        DocumentMapper docMapper = MapperTests.newParser().parse(mapping);
        byte[] json = copyToBytesFromClasspath("/org/elasticsearch/index/mapper/simple/test1-notype-noid.json");
        Document doc = docMapper.parse("person", "1", json).rootDoc();
        assertThat(doc.get(docMapper.uidMapper().names().indexName()), equalTo(Uid.createUid("person", "1")));
        assertThat((double) doc.getBoost(), closeTo(3.7, 0.01));
        assertThat(doc.get(docMapper.mappers().name("first").mapper().names().indexName()), equalTo("shay"));
//        System.out.println("Document: " + doc);
//        System.out.println("Json: " + docMapper.sourceMapper().value(doc));
    }
View Full Code Here

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

    @Override
    public Engine.Delete prepareDelete(String type, String id, long version, VersionType versionType, Engine.Operation.Origin origin) throws ElasticsearchException {
        long startTime = System.nanoTime();
        DocumentMapper docMapper = mapperService.documentMapperWithAutoCreate(type).v1();
        return new Engine.Delete(type, id, docMapper.uidMapper().term(type, id), version, versionType, origin, startTime, false);
    }

    @Override
    public void delete(Engine.Delete delete) throws ElasticsearchException {
        writeAllowed(delete.origin());
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.