Examples of DocIdAndVersion


Examples of org.elasticsearch.common.lucene.uid.Versions.DocIdAndVersion

                        docID = d;
                    }

                    if (docID != DocsEnum.NO_MORE_DOCS) {
                        if (segVersions != null) {
                            return new DocIdAndVersion(docID, segVersions.get(docID), readerContexts[seg]);
                        } else {
                            // _uid found, but no doc values and no payloads
                            return new DocIdAndVersion(docID, Versions.NOT_SET, readerContexts[seg]);
                        }
                    } else {
                        assert hasDeletions;
                        continue;
                    }
                }

                // ... but used to be stored as payloads; in this case we must use DocsAndPositionsEnum
                DocsAndPositionsEnum dpe = posEnums[seg] = termsEnums[seg].docsAndPositions(liveDocs[seg], posEnums[seg], DocsAndPositionsEnum.FLAG_PAYLOADS);
                assert dpe != null; // terms has payloads
                int docID = DocsEnum.NO_MORE_DOCS;
                for (int d = dpe.nextDoc(); d != DocsEnum.NO_MORE_DOCS; d = dpe.nextDoc()) {
                    docID = d;
                    dpe.nextPosition();
                    final BytesRef payload = dpe.getPayload();
                    if (payload != null && payload.length == 8) {
                        // TODO: does this break the nested docs case?  we are not returning the last matching docID here?
                        return new DocIdAndVersion(d, Numbers.bytesToLong(payload), readerContexts[seg]);
                    }
                }
            }
        }
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.