作者:___墨浔 | 来源:互联网 | 2023-06-09 12:23
本文整理了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;
}