Package org.elasticsearch.index.field.data.floats

Examples of org.elasticsearch.index.field.data.floats.FloatFieldData


                }

                if (inclusiveLowerPoint > inclusiveUpperPoint)
                    return DocSet.EMPTY_DOC_SET;

                final FloatFieldData fieldData = (FloatFieldData) this.fieldDataCache.cache(FieldDataType.DefaultTypes.FLOAT, 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()) {
                            float[] values = fieldData.values(doc);
                            for (float value : values) {
                                if (value >= inclusiveLowerPoint && value <= inclusiveUpperPoint) {
                                    return true;
                                }
                            }
                            return false;
                        } else {
                            float value = fieldData.value(doc);
                            return value >= inclusiveLowerPoint && value <= inclusiveUpperPoint;
                        }
                    }
                };
            }
View Full Code Here


        }

        if (allTerms) {
            try {
                for (IndexReader reader : context.searcher().subReaders()) {
                    FloatFieldData fieldData = (FloatFieldData) 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.floats.FloatFieldData

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.