Package org.elasticsearch.index.field.data.longs

Examples of org.elasticsearch.index.field.data.longs.LongFieldData$ValueProc


                }

                if (inclusiveLowerPoint > inclusiveUpperPoint)
                    return DocSet.EMPTY_DOC_SET;

                final LongFieldData fieldData = (LongFieldData) this.fieldDataCache.cache(FieldDataType.DefaultTypes.LONG, reader, field);
                return new GetDocSet(reader.maxDoc()) {

                    @Override public boolean isCacheable() {
                        // not cacheable for several reasons:
                        // 1. It is only relevant when _cache is set to true, and then, we really want to create in mem bitset
                        // 2. Its already fast without in mem bitset, since it works with field data
                        return false;
                    }

                    @Override public boolean get(int doc) throws IOException {
                        if (!fieldData.hasValue(doc)) {
                            return false;
                        }
                        if (fieldData.multiValued()) {
                            long[] values = fieldData.values(doc);
                            for (long value : values) {
                                if (value >= inclusiveLowerPoint && value <= inclusiveUpperPoint) {
                                    return true;
                                }
                            }
                            return false;
                        } else {
                            long value = fieldData.value(doc);
                            return value >= inclusiveLowerPoint && value <= inclusiveUpperPoint;
                        }
                    }
                };
            }
View Full Code Here


        }

        if (allTerms) {
            try {
                for (IndexReader reader : context.searcher().subReaders()) {
                    LongFieldData fieldData = (LongFieldData) fieldDataCache.cache(fieldDataType, reader, indexFieldName);
                    fieldData.forEachValue(aggregator);
                }
            } catch (Exception e) {
                throw new FacetPhaseExecutionException(facetName, "failed to load all terms", e);
            }
        }
View Full Code Here

        }

        if (allTerms) {
            try {
                for (IndexReader reader : context.searcher().subReaders()) {
                    LongFieldData fieldData = (LongFieldData) fieldDataCache.cache(fieldDataType, reader, indexFieldName);
                    fieldData.forEachValue(aggregator);
                }
            } catch (Exception e) {
                throw new FacetPhaseExecutionException(facetName, "failed to load all terms", e);
            }
        }
View Full Code Here

TOP

Related Classes of org.elasticsearch.index.field.data.longs.LongFieldData$ValueProc

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.