本文整理汇总了Java中org.apache.lucene.document.FieldType.setDocValuesType方法的典型用法代码示例。如果您正苦于以下问题:Java FieldType.setDocValuesType方法的具体用法?Java FieldType.setDocValuesType怎么用?Java FieldType.setDocValuesType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.lucene.document.FieldType
的用法示例。
在下文中一共展示了FieldType.setDocValuesType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getType
import org.apache.lucene.document.FieldType; //导入方法依赖的package包/类
private static FieldType getType(int numDims) {
FieldType type = new FieldType();
type.setDimensions(numDims, Float.BYTES);
type.setDocValuesType(DocValuesType.NUMERIC);
type.freeze();
return type;
}
示例2: getType
import org.apache.lucene.document.FieldType; //导入方法依赖的package包/类
private static FieldType getType(int numDims) {
FieldType type = new FieldType();
type.setDocValuesType(DocValuesType.NUMERIC);
type.setDimensions(numDims, Integer.BYTES);
type.freeze();
return type;
}
示例3: addCommonDocumentFields
import org.apache.lucene.document.FieldType; //导入方法依赖的package包/类
private void addCommonDocumentFields(Document document, FeatureIndexEntry entry, final Long featureFileId) {
document.add(new SortedStringField(FeatureIndexFields.FEATURE_ID.getFieldName(), entry.getFeatureId()));
FieldType fieldType = new FieldType();
fieldType.setOmitNorms(true);
fieldType.setIndexOptions(IndexOptions.DOCS);
fieldType.setStored(true);
fieldType.setTokenized(false);
fieldType.setDocValuesType(DocValuesType.SORTED);
fieldType.freeze();
Field field = new Field(FeatureIndexFields.CHROMOSOME_ID.getFieldName(), entry.getChromosome() != null ?
new BytesRef(entry.getChromosome().getId().toString()) : new BytesRef(""), fieldType);
document.add(field);
document.add(new SortedStringField(FeatureIndexFields.CHROMOSOME_NAME.getFieldName(),
entry.getChromosome().getName(), true));
document.add(new SortedIntPoint(FeatureIndexFields.START_INDEX.getFieldName(), entry.getStartIndex()));
document.add(new StoredField(FeatureIndexFields.START_INDEX.getFieldName(), entry.getStartIndex()));
document.add(new SortedDocValuesField(FeatureIndexFields.START_INDEX.getGroupName(),
new BytesRef(entry.getStartIndex().toString())));
document.add(new SortedIntPoint(FeatureIndexFields.END_INDEX.getFieldName(), entry.getEndIndex()));
document.add(new StoredField(FeatureIndexFields.END_INDEX.getFieldName(), entry.getEndIndex()));
document.add(new SortedDocValuesField(FeatureIndexFields.END_INDEX.getGroupName(),
new BytesRef(entry.getStartIndex().toString())));
document.add(new StringField(FeatureIndexFields.FEATURE_TYPE.getFieldName(),
entry.getFeatureType() != null ? entry.getFeatureType().getFileValue() : "", Field.Store.YES));
document.add(new StringField(FeatureIndexFields.FILE_ID.getFieldName(), featureFileId.toString(),
Field.Store.YES));
document.add(new StringField(FeatureIndexFields.FEATURE_NAME.getFieldName(),
entry.getFeatureName() != null ? entry.getFeatureName().toLowerCase() : "", Field.Store.YES));
document.add(new SortedDocValuesField(FeatureIndexFields.FEATURE_NAME.getFieldName(),
new BytesRef(entry.getFeatureName() != null ? entry.getFeatureName() : "")));
document.add(new SortedSetDocValuesFacetField(FeatureIndexFields.CHR_ID.getFieldName(),
entry.getChromosome().getId().toString()));
document.add(new SortedStringField(FeatureIndexFields.UID.getFieldName(), entry.getUuid().toString()));
document.add(new SortedSetDocValuesFacetField(FeatureIndexFields.F_UID.getFieldName(),
entry.getUuid().toString()));
}