本文整理汇总了Java中org.apache.lucene.document.Document.removeField方法的典型用法代码示例。如果您正苦于以下问题:Java Document.removeField方法的具体用法?Java Document.removeField怎么用?Java Document.removeField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.lucene.document.Document
的用法示例。
在下文中一共展示了Document.removeField方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: indexFast
import org.apache.lucene.document.Document; //导入方法依赖的package包/类
@Override
public void indexFast(IndexedItem indexedItem)
{
Item item = indexedItem.getItem();
List<ActivateRequest> activateRequests = activationService.getAllRequests(item);
Document itemdoc = indexedItem.getItemdoc();
List<Fieldable> basicFields = indexedItem.getBasicFields();
List<Document> activationDocs = indexedItem.getDocumentsForIndex(ActivationConstants.ACTIVATION_INDEX_ID);
for( ActivateRequest request : activateRequests )
{
if( request.getCourse() != null )
{
itemdoc.add(keyword(FreeTextQuery.FIELD_COURSE_ID, request.getCourse().getUuid()));
Document doc = new Document();
addAllFields(doc, basicFields);
doc.add(keyword(FreeTextQuery.FIELD_COURSE_ID, request.getCourse().getUuid()));
doc.add(keyword(FreeTextQuery.FIELD_ACTIVATION_ID, Long.toString(request.getId())));
doc.add(keyword(FreeTextQuery.FIELD_ACTIVATION_STATUS, String.valueOf(request.getStatus())));
doc.add(indexed(FreeTextQuery.FIELD_OWNER, request.getUser()));
doc.removeField(FreeTextQuery.FIELD_REALLASTMODIFIED);
doc.add(keyword(FreeTextQuery.FIELD_REALLASTMODIFIED, new UtcDate(request.getTime()).format(Dates.ISO)));
doc.add(indexed(FreeTextQuery.FIELD_ACTIVATION_FROM, new UtcDate(request.getFrom()).format(Dates.ISO)));
doc.add(indexed(FreeTextQuery.FIELD_ACTIVATION_UNTIL, new UtcDate(request.getUntil()).format(Dates.ISO)));
addAllFields(doc, indexedItem.getACLEntries(ActivationConstants.VIEW_ACTIVATION_ITEM));
activationDocs.add(doc);
}
}
}