Hi, Our main data storage is MySql tables. We index it on Lucene in order to improve the search (boosting, proximate spelling, etc). We naturally maintain it - for example, to insert a new "Contract" entity, we have: addContract(Contract cont){ // INSERT into MySQL: hibernateSession.save(cont); // Index in Lucene: Document d=new Document(); d.addField(new Field ("title", cont.getTitle()...) d.addField(new Field ("body", cont.getBody()...) indexWriter.addDocument(d); ... }
This works, but becomes a maintenance nightmare when the index fields are collected from JOINS. For example, we also want Lucene to search contracts by "author name", which is taken from another table AUTHOR (through Foreign Key). And then if the author name changes (e.g. through marriage), you must remember to re-index all her contracts...! Does anyone have experience with such database/lucene combination, and knows of a solution that would be reasonable to maintain? Thanks.