本文整理汇总了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);
}
}
示例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
);
}
示例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));
}
示例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);
}
示例5: valueAt
import org.apache.lucene.util.NumericUtils; //导入方法依赖的package包/类
@Override
public double valueAt(int index) {
return NumericUtils.sortableLongToDouble(values.valueAt(index));
}
示例6: get
import org.apache.lucene.util.NumericUtils; //导入方法依赖的package包/类
@Override
public double get(int docID) {
return NumericUtils.sortableLongToDouble(values.get(docID));
}
示例7: parseDouble
import org.apache.lucene.util.NumericUtils; //导入方法依赖的package包/类
@Override
public double parseDouble(BytesRef term) {
return NumericUtils.sortableLongToDouble(NumericUtils.prefixCodedToLong(term));
}
示例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);
}
示例9: toDouble
import org.apache.lucene.util.NumericUtils; //导入方法依赖的package包/类
@Override
public double toDouble(BytesRef indexForm) {
return NumericUtils.sortableLongToDouble(NumericUtils.prefixCodedToLong(indexForm));
}
示例10: toNumber
import org.apache.lucene.util.NumericUtils; //导入方法依赖的package包/类
@Override
public Number toNumber(BytesRef indexForm) {
return NumericUtils.sortableLongToDouble(NumericUtils.prefixCodedToLong(indexForm));
}
示例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;
}