Package org.elasticsearch.common.lucene.uid

Examples of org.elasticsearch.common.lucene.uid.UidField.version()


    private void innerCreate(Create create, IndexWriter writer) throws IOException {
        synchronized (dirtyLock(create.uid())) {
            UidField uidField = create.uidField();
            if (create.origin() == Operation.Origin.RECOVERY) {
                uidField.version(create.version());
                // we use update doc and not addDoc since we might get duplicates when using transient translog
                if (create.docs().size() > 1) {
                    writer.updateDocuments(create.uid(), create.docs(), create.analyzer());
                } else {
                    writer.updateDocument(create.uid(), create.docs().get(0), create.analyzer());
View Full Code Here


                } else if (currentVersion != -1) {
                    // its not deleted, its already there
                    throw new DocumentAlreadyExistsEngineException(shardId, create.type(), create.id());
                }

                uidField.version(updatedVersion);
                create.version(updatedVersion);

                if (create.docs().size() > 1) {
                    writer.addDocuments(create.docs(), create.analyzer());
                } else {
View Full Code Here

    private void innerIndex(Index index, IndexWriter writer) throws IOException {
        synchronized (dirtyLock(index.uid())) {
            UidField uidField = index.uidField();
            if (index.origin() == Operation.Origin.RECOVERY) {
                uidField.version(index.version());
                if (index.docs().size() > 1) {
                    writer.updateDocuments(index.uid(), index.docs(), index.analyzer());
                } else {
                    writer.updateDocument(index.uid(), index.docs().get(0), index.analyzer());
                }
View Full Code Here

                    }
                    // replicas already hold the "future" version
                    updatedVersion = index.version();
                }

                uidField.version(updatedVersion);
                index.version(updatedVersion);

                if (currentVersion == -1) {
                    // document does not exists, we can optimize for create
                    if (index.docs().size() > 1) {
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.