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


Java NumericUtils.sortableLongToDouble方法代码示例

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


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

示例1: toObject

import org.apache.lucene.util.NumericUtils; //导入方法依赖的package包/类
@Override
public Object toObject(SchemaField sf, BytesRef term) {
  switch (type) {
    case INTEGER:
      return NumericUtils.prefixCodedToInt(term);
    case FLOAT:
      return NumericUtils.sortableIntToFloat(NumericUtils.prefixCodedToInt(term));
    case LONG:
      return NumericUtils.prefixCodedToLong(term);
    case DOUBLE:
      return NumericUtils.sortableLongToDouble(NumericUtils.prefixCodedToLong(term));
    case DATE:
      return new Date(NumericUtils.prefixCodedToLong(term));
    default:
      throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Unknown type for trie field: " + type);
  }
}
 
开发者ID:europeana,项目名称:search,代码行数:18,代码来源:TrieField.java

示例2: stats

import org.apache.lucene.util.NumericUtils; //导入方法依赖的package包/类
@Override
public FieldStats stats(Terms terms, int maxDoc) throws IOException {
    double minValue = NumericUtils.sortableLongToDouble(NumericUtils.getMinLong(terms));
    double maxValue = NumericUtils.sortableLongToDouble(NumericUtils.getMaxLong(terms));
    return new FieldStats.Double(
        maxDoc, terms.getDocCount(), terms.getSumDocFreq(), terms.getSumTotalTermFreq(), minValue, maxValue
    );
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:9,代码来源:DoubleFieldMapper.java

示例3: getDoubleDocValue

import org.apache.lucene.util.NumericUtils; //导入方法依赖的package包/类
private static Double getDoubleDocValue(AtomicReaderContext atomContext, int docID, String field)
        throws IOException {
    NumericDocValues dvs = atomContext.reader().getNumericDocValues(field);
    if (dvs == null) {
        throw new IllegalStateException("No NumericDocValues for field '" + field + "'");
    }
    return NumericUtils.sortableLongToDouble(dvs.get(docID));
}
 
开发者ID:netarchivesuite,项目名称:dvenabler,代码行数:9,代码来源:DVReaderTest.java

示例4: convertToDouble

import org.apache.lucene.util.NumericUtils; //导入方法依赖的package包/类
private static DoubleTerms.Bucket convertToDouble(LongTerms.Bucket bucket) {
    double value = NumericUtils.sortableLongToDouble(bucket.term);
    return new DoubleTerms.Bucket(value, bucket.docCount, bucket.aggregations, bucket.showDocCountError, bucket.docCountError,
            bucket.format);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:6,代码来源:DoubleTermsAggregator.java

示例5: valueAt

import org.apache.lucene.util.NumericUtils; //导入方法依赖的package包/类
@Override
public double valueAt(int index) {
    return NumericUtils.sortableLongToDouble(values.valueAt(index));
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:SortableLongBitsToSortedNumericDoubleValues.java

示例6: get

import org.apache.lucene.util.NumericUtils; //导入方法依赖的package包/类
@Override
public double get(int docID) {
    return NumericUtils.sortableLongToDouble(values.get(docID));
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:SortableLongBitsToNumericDoubleValues.java

示例7: parseDouble

import org.apache.lucene.util.NumericUtils; //导入方法依赖的package包/类
@Override
public double parseDouble(BytesRef term) {
  return NumericUtils.sortableLongToDouble(NumericUtils.prefixCodedToLong(term));
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:FieldCache.java

示例8: convertToDouble

import org.apache.lucene.util.NumericUtils; //导入方法依赖的package包/类
private static DoubleTerms.Bucket convertToDouble(InternalTerms.Bucket bucket) {
    final long term = ((Number) bucket.getKey()).longValue();
    final double value = NumericUtils.sortableLongToDouble(term);
    return new DoubleTerms.Bucket(value, bucket.docCount, bucket.aggregations, bucket.showDocCountError, bucket.docCountError, bucket.formatter);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:6,代码来源:DoubleTermsAggregator.java

示例9: toDouble

import org.apache.lucene.util.NumericUtils; //导入方法依赖的package包/类
@Override
public double toDouble(BytesRef indexForm) {
    return NumericUtils.sortableLongToDouble(NumericUtils.prefixCodedToLong(indexForm));
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:5,代码来源:IndexNumericFieldData.java

示例10: toNumber

import org.apache.lucene.util.NumericUtils; //导入方法依赖的package包/类
@Override
public Number toNumber(BytesRef indexForm) {
    return NumericUtils.sortableLongToDouble(NumericUtils.prefixCodedToLong(indexForm));
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:5,代码来源:IndexNumericFieldData.java

示例11: readTerm

import org.apache.lucene.util.NumericUtils; //导入方法依赖的package包/类
@Override
public String readTerm(BytesRef byteRef) {
 if(NumericUtils.getPrefixCodedLongShift(byteRef) == 0)
  return NumericUtils.sortableLongToDouble(NumericUtils.prefixCodedToLong(byteRef))+"";
 return null;
}
 
开发者ID:apache,项目名称:incubator-blur,代码行数:7,代码来源:DoubleFieldTypeDefinition.java


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