更新Lucene索引策略
我正在将 Lucene 集成到 cms 中。我不知道更新索引是如何工作的。我知道如何创建和更新它,但我想知道是否有明智的策略来保持索引更新。每次将内容添加到数据库时是否都需要更新索引? Lucene性能好吗?
i'm integrating Lucene in a cms. I don't have a clue about how updating an index work. I know how to create and update it but i would like to know if there are smart strategies to keep the index updated. Do i need to update the index everytime a content is added to the DB? Does Lucene have good performances?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你不能在lucene中更新文档,你必须删除它并重新添加它。是的,lucene 非常快。
You can't update a document in lucene, you have to delete it and re-add it. And yes, lucene is VERY fast.
这取决于您是否需要添加到数据库的数据在添加后立即可供搜索。 (更像实时)
如果数据库中有大量且频繁的更新,那么这不会是一个很好的性能。
对索引进行增量更新就可以了(数据导入处理程序支持是开箱即用的),这将允许您仅索引在上次构建时间的时间范围内添加到数据库的增量项目。
Lucene 的性能太好了。
您可以定期进一步优化索引以获得更好的性能。
It depends if you need the data added to DB to be searchable as soon as it it added. (more real time like)
That would not be a nice performance, if you have heavy and frequent updates in the db.
Doing incremental updates to your index would be fine (data import handler supports is out of the box), which would allow you to index only the incremental items added to db during the time frame from the last build time.
Lucene performances are too good.
You can optimize you index periodically further for better performance.