Examples of GlobalOrdinalMapping


Examples of org.elasticsearch.index.fielddata.ordinals.GlobalOrdinalMapping

        private void mapSegmentCountsToGlobalCounts() {
            // There is no public method in Ordinals.Docs that allows for this mapping...
            // This is the cleanest way I can think of so far

            GlobalOrdinalMapping mapping;
            if (globalOrds instanceof GlobalOrdinalMapping) {
                mapping = (GlobalOrdinalMapping) globalOrds;
            } else {
                assert globalOrds.getValueCount() == segmentOrds.getValueCount();
                mapping = null;
            }
            for (long i = 1; i < segmentDocCounts.size(); i++) {
                final int inc = segmentDocCounts.set(i, 0);
                if (inc == 0) {
                    continue;
                }
                final long ord = i - 1; // remember we do +1 when counting
                final long globalOrd = mapping == null ? ord : mapping.getGlobalOrd(ord);
                try {
                    incrementBucketDocCount(globalOrd, inc);
                } catch (IOException e) {
                    throw ExceptionsHelper.convertToElastic(e);
                }
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.