Package org.elasticsearch.index.fielddata

Examples of org.elasticsearch.index.fielddata.ScriptDocValues$Doubles


            return type;
        }

        @Override
        public Object evaluate(DocLookup doc) {
            ScriptDocValues docValues = (ScriptDocValues)doc.get(fieldName);
            if (docValues == null || docValues.isEmpty()) {
                return null;
            } else {
                if (type.equals(DataTypes.DOUBLE)) {
                    return ((ScriptDocValues.Doubles)docValues).getValue();
                } else if (type.equals(DataTypes.LONG)) {
View Full Code Here


                hitContext.hit().fields().put(field.name(), hitField);
            }
            FieldMapper mapper = context.mapperService().smartNameFieldMapper(field.name());
            if (mapper != null) {
                AtomicFieldData data = context.fieldData().getForField(mapper).load(hitContext.readerContext());
                ScriptDocValues values = data.getScriptValues();
                values.setNextDocId(hitContext.docId());
                hitField.values().addAll(values.getValues());
            }
        }
    }
View Full Code Here

    @Override
    public Object get(Object key) {
        // assume its a string...
        String fieldName = key.toString();
        ScriptDocValues scriptValues = localCacheFieldData.get(fieldName);
        if (scriptValues == null) {
            FieldMapper mapper = mapperService.smartNameFieldMapper(fieldName, types);
            if (mapper == null) {
                throw new ElasticsearchIllegalArgumentException("No field found for [" + fieldName + "] in mapping with types " + Arrays.toString(types) + "");
            }
            scriptValues = fieldDataService.getForField(mapper).load(reader).getScriptValues();
            localCacheFieldData.put(fieldName, scriptValues);
        }
        scriptValues.setNextDocId(docId);
        return scriptValues;
    }
View Full Code Here

    }

    public boolean containsKey(Object key) {
        // assume its a string...
        String fieldName = key.toString();
        ScriptDocValues scriptValues = localCacheFieldData.get(fieldName);
        if (scriptValues == null) {
            FieldMapper mapper = mapperService.smartNameFieldMapper(fieldName, types);
            if (mapper == null) {
                return false;
            }
View Full Code Here

TOP

Related Classes of org.elasticsearch.index.fielddata.ScriptDocValues$Doubles

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.