tags:

views:

32

answers:

1

What's the best way to get a notification (say an event) when a keyword is found in a document in Lucene?

The brute force way is to keep searching for the keyword in short intervals but that seems very inefficient as well as not as "real-time"

+2  A: 

Take a look at MemoryIndex:

http://lucene.apache.org/java/2_2_0/api/org/apache/lucene/index/memory/MemoryIndex.html

It's part of Lucene contrib, and it is designed for publish/subscribe systems that you're building. However, it's been a while since I've looked at this, and I'm not sure if it's being actively maintained.

bajafresh4life
I think this is closest I can get to what I want. Although I'm not quite comfortable with the fact that it holds the index in memory. I'd rather have a scalable but slower solution.
Khash