本文整理汇总了Java中org.apache.lucene.index.DocValuesType.NUMERIC属性的典型用法代码示例。如果您正苦于以下问题:Java DocValuesType.NUMERIC属性的具体用法?Java DocValuesType.NUMERIC怎么用?Java DocValuesType.NUMERIC使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.lucene.index.DocValuesType
的用法示例。
在下文中一共展示了DocValuesType.NUMERIC属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readDocValues
private Object readDocValues(String field, DocValuesType docValType, LeafReader atomicReader) throws IOException{
Object docVals = null;
if (docValType == DocValuesType.NUMERIC) {
docVals = atomicReader.getNumericDocValues(field);
}
else if (docValType == DocValuesType.BINARY) {
docVals = atomicReader.getBinaryDocValues(field);
}
else if (docValType == DocValuesType.SORTED) {
docVals = atomicReader.getSortedDocValues(field);
}
else if (docValType == DocValuesType.SORTED_NUMERIC) {
docVals = atomicReader.getSortedNumericDocValues(field);
}
else if (docValType == DocValuesType.SORTED_SET) {
docVals = atomicReader.getSortedSetDocValues(field);
}
return docVals;
}
示例2: VersionFieldUpgrader
VersionFieldUpgrader(CodecReader in) {
super(in);
// Find a free field number
int fieldNumber = 0;
for (FieldInfo fi : in.getFieldInfos()) {
fieldNumber = Math.max(fieldNumber, fi.number + 1);
}
// TODO: lots of things can wrong here...
FieldInfo newInfo = new FieldInfo(VersionFieldMapper.NAME, // field name
fieldNumber, // field number
false, // store term vectors
false, // omit norms
false, // store payloads
IndexOptions.NONE, // index options
DocValuesType.NUMERIC, // docvalues
-1, // docvalues generation
Collections.<String, String>emptyMap() // attributes
);
newInfo.checkConsistency(); // fail merge immediately if above code is wrong
final ArrayList<FieldInfo> fieldInfoList = new ArrayList<>();
for (FieldInfo info : in.getFieldInfos()) {
if (!info.name.equals(VersionFieldMapper.NAME)) {
fieldInfoList.add(info);
}
}
fieldInfoList.add(newInfo);
infos = new FieldInfos(fieldInfoList.toArray(new FieldInfo[fieldInfoList.size()]));
}