Package org.elasticsearch.index.fielddata

Examples of org.elasticsearch.index.fielddata.SortedBinaryDocValues


        return Collections.emptyList();
    }

    @Override
    public SortedBinaryDocValues getBytesValues() {
        return new SortedBinaryDocValues() {

            int count;
            BytesRefBuilder[] refs = new BytesRefBuilder[0];
            final ByteArrayDataInput in = new ByteArrayDataInput();
View Full Code Here


        return new ScriptDocValues.Strings(getBytesValues());
    }

    @Override
    public final SortedBinaryDocValues getBytesValues() {
        return new SortedBinaryDocValues() {

            private final BytesRef[] terms = new BytesRef[2];
            private int count;

            @Override
View Full Code Here

        if (bucketCountThresholds.getMinDocCount() == 0 && (order != InternalOrder.COUNT_DESC || bucketOrds.size() < bucketCountThresholds.getRequiredSize())) {
            // we need to fill-in the blanks
            for (LeafReaderContext ctx : context.searchContext().searcher().getTopReaderContext().leaves()) {
                context.setNextReader(ctx);
                final SortedBinaryDocValues values = valuesSource.bytesValues();
                // brute force
                for (int docId = 0; docId < ctx.reader().maxDoc(); ++docId) {
                    values.setDocument(docId);
                    final int valueCount = values.count();
                    for (int i = 0; i < valueCount; ++i) {
                        final BytesRef term = values.valueAt(i);
                        if (includeExclude == null || includeExclude.accept(term)) {
                            bucketOrds.add(term);
                        }
                    }
                }
View Full Code Here

        final BytesRef nonNullMissingBytes = missingBytes == null ? nullPlaceHolder : missingBytes;
        return new FieldComparator.TermValComparator(numHits, null, sortMissingLast) {

            @Override
            protected BinaryDocValues getBinaryDocValues(LeafReaderContext context, String field) throws IOException {
                final SortedBinaryDocValues values = getValues(context);
                final BinaryDocValues selectedValues;
                if (nested == null) {
                    selectedValues = sortMode.select(values, nonNullMissingBytes);
                } else {
                    final BitSet rootDocs = nested.rootDocs(context).bits();
View Full Code Here

        @Override
        public DocIdSet getDocIdSet(LeafReaderContext context, Bits acceptDocs) throws IOException {
            // make sure there are terms to filter on
            if (terms == null || terms.isEmpty()) return null;

            final SortedBinaryDocValues values = fieldData.load(context).getBytesValues(); // load fielddata
            return new DocValuesDocIdSet(context.reader().maxDoc(), acceptDocs) {
                @Override
                protected boolean matchDoc(int doc) {
                    values.setDocument(doc);
                    final int numVals = values.count();
                    for (int i = 0; i < numVals; i++) {
                        if (terms.contains(values.valueAt(i))) {
                            return true;
                        }
                    }

                    return false;
View Full Code Here

TOP

Related Classes of org.elasticsearch.index.fielddata.SortedBinaryDocValues

Copyright © 2018 www.massapicom. 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.