当前位置: 首页>>代码示例>>Java>>正文


Java ScriptDocValues.Longs方法代码示例

本文整理汇总了Java中org.elasticsearch.index.fielddata.ScriptDocValues.Longs方法的典型用法代码示例。如果您正苦于以下问题:Java ScriptDocValues.Longs方法的具体用法?Java ScriptDocValues.Longs怎么用?Java ScriptDocValues.Longs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.elasticsearch.index.fielddata.ScriptDocValues的用法示例。


在下文中一共展示了ScriptDocValues.Longs方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getScriptValues

import org.elasticsearch.index.fielddata.ScriptDocValues; //导入方法依赖的package包/类
@Override
public final ScriptDocValues<?> getScriptValues() {
    switch (numericType) {
    case DATE:
        return new ScriptDocValues.Dates(getLongValues());
    case BOOLEAN:
        return new ScriptDocValues.Booleans(getLongValues());
    default:
        return new ScriptDocValues.Longs(getLongValues());
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:12,代码来源:AtomicLongFieldData.java

示例2: getFieldValue

import org.elasticsearch.index.fielddata.ScriptDocValues; //导入方法依赖的package包/类
/**
 * . Reads field value & returns it as String
 *
 * @param field the object to cast
 * @return String object String value
 */
private static String getFieldValue(final Object field) {
    String result = "";

    if (field instanceof ScriptDocValues.Strings) {
        if (!((ScriptDocValues.Strings) field).isEmpty()) {
            result = ((ScriptDocValues.Strings) field).getValue();
        }
    }

    if (field instanceof ScriptDocValues.Doubles) {
        if (!((ScriptDocValues.Doubles) field).isEmpty()) {
            result = Double.toString(((ScriptDocValues.Doubles) field).getValue());
        }
    }
    if (field instanceof ScriptDocValues.Longs) {
        if (!((ScriptDocValues.Longs) field).isEmpty()) {
            result = Long.toString(((ScriptDocValues.Longs) field).getValue());
        }
    }
    if (field instanceof ScriptDocValues.GeoPoints) {
        if (!((ScriptDocValues.GeoPoints) field).isEmpty()) {
            ScriptDocValues.GeoPoints point = (ScriptDocValues.GeoPoints) field;
            result = String.format(Locale.getDefault(), "%s,%s", point.getLat(), point.getLon());
        }
    }

    return result;
}
 
开发者ID:YannBrrd,项目名称:elasticsearch-entity-resolution,代码行数:35,代码来源:EntityResolutionScript.java

示例3: run

import org.elasticsearch.index.fielddata.ScriptDocValues; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Object run() {
    ArrayList<Long> transactions = (ArrayList<Long>) agg.get(InitScriptFactory.TRANSACTIONS_FIELD);
    ScriptDocValues.Longs amount = (ScriptDocValues.Longs) doc().get("amount");
    ScriptDocValues.Strings type = (ScriptDocValues.Strings) doc().get("type");
    if ("sale".equals(type.getValue())) {
        transactions.add(amount.getValue());
    } else {
        transactions.add(-amount.getValue());
    }
    return null;
}
 
开发者ID:imotov,项目名称:elasticsearch-native-script-example,代码行数:14,代码来源:MapScriptFactory.java

示例4: docFieldLongs

import org.elasticsearch.index.fielddata.ScriptDocValues; //导入方法依赖的package包/类
/**
 * Returns field data long (integers) access for the provided field.
 */
protected ScriptDocValues.Longs docFieldLongs(String field) {
    return (ScriptDocValues.Longs) doc().get(field);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:7,代码来源:AbstractSearchScript.java

示例5: getScriptValues

import org.elasticsearch.index.fielddata.ScriptDocValues; //导入方法依赖的package包/类
@Override
public final ScriptDocValues getScriptValues() {
    return new ScriptDocValues.Longs(getLongValues());
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:5,代码来源:AtomicLongFieldData.java


注:本文中的org.elasticsearch.index.fielddata.ScriptDocValues.Longs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。