简体   繁体   English

使用lucene更新文档字段

[英]Updating documents fields using lucene

i'm trying to update an indexed documents in lucene by searching for the document, and then extracting the indexed document fields, and then deleting the document and creating a new one. 我正在尝试通过搜索文档更新lucene中的索引文档,然后提取索引文档字段,然后删除文档并创建一个新文档。 is there anther effective way for such an update? 有这种更新的另一种有效方式吗?

There isn't. 没有。 The best you can get is IndexWriter.updateDocument(Term term, Iterable<? extends IndexableField> document) but even this deletes and adds the same document again. 您可以获得的最好的是IndexWriter.updateDocument(Term term, Iterable<? extends IndexableField> document)但即使这样也会删除并再次添加相同的文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM