本文整理了Java中org.apache.lucene.document.Field.UnStored()
方法的一些代码示例,展示了Field.UnStored()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Field.UnStored()
方法的具体详情如下:
包路径:org.apache.lucene.document.Field
类名称:Field
方法名:UnStored
[英]Constructs a String-valued Field that is tokenized and indexed, but that is not stored in the index. Term vector will not be stored for this field.
[中]构造一个字符串值字段,该字段已标记并索引,但未存储在索引中。将不会为此字段存储术语向量。
代码示例来源:origin: lucene/lucene
/** Constructs a String-valued Field that is tokenized and indexed,
but that is not stored in the index. Term vector will not be stored for this field. */
public static final Field UnStored(String name, String value) {
return UnStored(name, value, false);
}
代码示例来源:origin: pebbleblog/pebble
document.add(Field.UnIndexed("date", DateField.dateToString(staticPage.getDate())));
if (staticPage.getBody() != null) {
document.add(Field.UnStored("body", staticPage.getBody()));
} else {
document.add(Field.UnStored("body", ""));
document.add(Field.UnStored("blogEntry", searchableContent.toString()));
代码示例来源:origin: org.apache.servicemix/servicemix-audit
protected Document createDocument(MessageExchange me) throws MessagingException {
try {
// This could be in a separated class (a LuceneDocumentProvider)
SourceTransformer st = new SourceTransformer();
Document d = new Document();
d.add(Field.Keyword("org.apache.servicemix.exchangeid", me.getExchangeId()));
d.add(Field.Keyword("org.apache.servicemix.exchangestatus", String.valueOf(me.getStatus())));
String[] types = {"in", "out", "fault" };
for (int i = 0; i < types.length; i++) {
String type = types[i];
NormalizedMessage nm = me.getMessage(type);
if (nm != null) {
d.add(Field.UnStored("org.apache.servicemix." + type + ".contents", st.contentToString(nm)));
addMessagePropertiesToDocument(nm, d, type);
}
}
return d;
} catch (MessagingException mse) {
throw mse;
} catch (Exception ex) {
throw new MessagingException("Error while creating Lucene Document", ex);
}
}
代码示例来源:origin: pebbleblog/pebble
document.add(Field.UnIndexed("date", DateField.dateToString(blogEntry.getDate())));
if (blogEntry.getBody() != null) {
document.add(Field.UnStored("body", blogEntry.getBody()));
} else {
document.add(Field.UnStored("body", ""));
document.add(Field.UnStored("blogEntry", searchableContent.toString()));
内容来源于网络,如有侵权,请联系作者删除!