开发者

How often can I update a Lucene index?

开发者 https://www.devze.com 2023-02-15 12:11 出处:网络
Is it ok to update a lucene index frequently (every few seconds)?The updates will equally be adds and updates and searching will be happening at the same开发者_C百科 time.I\'ll prefix this answer with

Is it ok to update a lucene index frequently (every few seconds)? The updates will equally be adds and updates and searching will be happening at the same开发者_C百科 time.


I'll prefix this answer with "I've only used Java Lucene", but this should still all apply: It's certainly fine to do what you're describing, in a general sense. What you'll find is that Lucene creates a lot of additional index files in your directory, which account for each add and update. These will be searched transparently. Naturally, over time if this number of additonal files becomes too large, your search performance will degrade. This is when you need to run an optimise, which can be extremely fast or extremely slow, depending on the size of your index.

At the end of the day, it's hard for anyone to comment on how your performance will be, and how frequently you should optimise, nevertheless, I can say that Lucene will handle fundamentally what you're trying to do.


This is fine as long as you use NRT. (Singleton IndexWriter.)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号