0
votes

I'm developing an application that uses Lucene.net, and there's a use case I don't know how to handle. Let's say I have 'books' and 'authors', which correspond to 2 different tables and objects. If I create an author "John Doe" and then create a book, I will also index the author for that book; that allows me do a search like "title author:Doe", and it will return all books.

Now let's say I go and rename the author to something else, all books will be OK in the database since there's a FK relationship. In Lucene however, the books will be outdated since they contain the name of the author as text.

How can I handle those cases? I guess Lucene doesn't have FK constraints or things like that.

(Note: tagged as Java because Lucene and Lucene.net are pretty similar)

1

1 Answers

0
votes

Unfortunately in Lucene, if you change the data indexed in one Lucene document, you need to change that corresponding indexed data in the other Lucene documents -- and Lucene in 2.9.x did not support any UPDATE capabilities (you have to add & delete each document).