简体   繁体   中英

How often can I update a Lucene index?

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 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.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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