本文整理匯總了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;
}