换汤不换药的UpdateDocuments
一直很好奇当初Apache曾经说的即将推出的UpdateDocuments()方法是个什么样的方法,Lucene索引的这种紧凑的文件结构如何能“允许”这个“Update”动作的发生呢?
千呼万唤始出来,不出所料,还是换汤不换药
注释
/// In either case, documents are added with {@link #AddDocument(Document)
/// addDocument} and removed with {@link #DeleteDocuments(Term)} or {@link
/// #DeleteDocuments(Query)}. A document can be updated with {@link
/// #UpdateDocument(Term, Document) updateDocument} (which just deletes
/// and then adds the entire document). When finished adding, deleting
/// and updating documents, {@link #Close() close} should be called.
/// addDocument} and removed with {@link #DeleteDocuments(Term)} or {@link
/// #DeleteDocuments(Query)}. A document can be updated with {@link
/// #UpdateDocument(Term, Document) updateDocument} (which just deletes
/// and then adds the entire document). When finished adding, deleting
/// and updating documents, {@link #Close() close} should be called.

浙公网安备 33010602011771号