Okay okay, I'll bite!
This is what I did (I didn't do what they did in the link I posted in your previous topic):
* I have a LuceneUtil class which is a singleton that manages the index (adding, updating, deleting, searching).
* At my business layer (not the DAO layer just in case I reimplement it in something else) I call the various add/update/delete methods to maintain the index.
* My search operation returns an array of IDs which I then pull out of the database.
Note, I only index one database table. If you wish to index more than one then you'll need a slightly more sophisticated method. If you've used Lucene then you should find it relatively easy to implement. I hacked mine out in a few hours having previously had no Lucene experience.
|