热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.apache.lucene.index.IndexableField.readerValue()方法的使用及代码示例

本文整理了Java中org.apache.lucene.index.IndexableField.readerValue()方法的一些代码示例,展示了IndexableField.readerValu

本文整理了Java中org.apache.lucene.index.IndexableField.readerValue()方法的一些代码示例,展示了IndexableField.readerValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IndexableField.readerValue()方法的具体详情如下:
包路径:org.apache.lucene.index.IndexableField
类名称:IndexableField
方法名:readerValue

IndexableField.readerValue介绍

[英]Non-null if this field has a Reader value
[中]如果此字段具有读取器值,则为非null

代码示例

代码示例来源:origin: oracle/opengrok

/**
* Do a best effort to clean up all resources allocated when populating
* a Lucene document. On normal execution, these resources should be
* closed automatically by the index writer once it's done with them, but
* we may not get that far if something fails.
*
* @param doc the document whose resources to clean up
*/
private static void cleanupResources(Document doc) {
for (IndexableField f : doc) {
// If the field takes input from a reader, close the reader.
IOUtils.close(f.readerValue());
// If the field takes input from a token stream, close the
// token stream.
if (f instanceof Field) {
IOUtils.close(((Field) f).tokenStreamValue());
}
}
}

代码示例来源:origin: ontopia/ontopia

@Override
public Reader getReader() {
return field.readerValue();
}

代码示例来源:origin: harbby/presto-connectors

@Override
public Reader readerValue() {
return getRealValue().readerValue();
}

代码示例来源:origin: org.apache.lucene/lucene-misc

@Override
public Reader readerValue() {
return getRealValue().readerValue();
}

代码示例来源:origin: org.infinispan/infinispan-embedded-query

@Override
public Reader readerValue() {
return getRealValue().readerValue();
}

代码示例来源:origin: org.opencms/opencms-core

/**
* @see org.opencms.search.I_CmsSearchDocument#getContentBlob()
*/
public byte[] getContentBlob() {
IndexableField fieldCOntentBlob= m_doc.getField(CmsSearchField.FIELD_CONTENT_BLOB);
if (fieldContentBlob != null) {
try {
if (fieldContentBlob.readerValue() != null) {
return IOUtils.toByteArray(fieldContentBlob.readerValue());
}
} catch (IOException e) {
// TODO:
}
}
return null;
}

代码示例来源:origin: org.apache.lucene/lucene-classification

private Document createNewDoc(IndexReader originalIndex, FieldType ft, ScoreDoc scoreDoc, String[] fieldNames) throws IOException {
Document doc = new Document();
Document document = originalIndex.document(scoreDoc.doc);
if (fieldNames != null && fieldNames.length > 0) {
for (String fieldName : fieldNames) {
IndexableField field = document.getField(fieldName);
if (field != null) {
doc.add(new Field(fieldName, field.stringValue(), ft));
}
}
} else {
for (IndexableField field : document.getFields()) {
if (field.readerValue() != null) {
doc.add(new Field(field.name(), field.readerValue(), ft));
} else if (field.binaryValue() != null) {
doc.add(new Field(field.name(), field.binaryValue(), ft));
} else if (field.stringValue() != null) {
doc.add(new Field(field.name(), field.stringValue(), ft));
} else if (field.numericValue() != null) {
doc.add(new Field(field.name(), field.numericValue().toString(), ft));
}
}
}
return doc;
}

推荐阅读
author-avatar
___墨浔
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有