Well I was developing an application when I realized a major drawback on Zend Lucene (or on the way I want to use it).
I have a model called Publication that is related with a few other models (subjects, genres, languages, authors, etc.) and I'm getting they're names when adding a new document to the index (using the Jobeet tutorial way) so that I can search for publications with a given subject, genre, language, author, etc... The problem is if for some reason I decide to alter the name of one of those related models the Zend Lucene index will not get updated.
The only two solutions I could come up with were:
1. Re-index all the publications regularly to guarantee that any changes made to the related models gets updated on the index (however this solution doesn't allow the index to be updated in real time)
2. Get all the publications that are related with a given model and re-index them after it gets updated (using the save(), postSave(), postUpdate() or whatever you can come up with on Doctrine).
--> This solution seems great... It will only rebuild the index for the publications that are linked to the updated model right? Well, if you have something like a thousand (1000) publications linked to it will take a few minutes (yeah I tested it) to update and on a user form it will timeout because it takes over 30 seconds (and even if it don't it would be bad to have a user looking at the screen for a few minutes awaiting for the page to finish to load).
So what I want to know is if there's another solution? Is there a way to update an index on the fly based on a change on a related model without hanging the whole pahe? Maybe putting the task to run on the background or something? Is there such a way?
If there's no way to do this with Lucene is there any way to use Full-Text Search with MySQL (with InnoDB tables) without using Zend Lucene that doesn't have such a drawback? If there's such a tool I'd glady refactor my code to accommodate a different library.
Could you please help me with this? Thanks in advance!