Lucee/Lucene purging issue

OS: Linux Amazon2 64bit
Java Version: 11.0.4 (AdoptOpenJDK) 64bit
Tomcat Version: 9.0.14
Lucee Version: Lucee 5.3.3.62

Hi all,

Got a bit of a knotty problem with a search collection using Lucene that I wonder if someone could help me with. I have a collection that’s being populated via several different DB queries.

When the data in the DB inevitably changes, I need the collection to reflect the new data, obviously. However, I’m seeing that a purge of the collection, followed by a reindex does not remove records that no longer exist in the DB.

An example:

I have 3 records in the DB, keys of: ‘cat’, ‘mouse’, ‘banana’.

The collection is indexed with those 3 keys.

Then in the DB I delete the ‘banana’ record. I then purge the collection, run a query to get the records from the DB and index the collection with the records from the DB.

You would now expect the collection to ONLY now contain 2 records, right?

Only, that’s not what I’m seeing. After I run the above, I’m still seeing the deleted ‘banana’ record in the Lucene collection. Something isn’t working in the purge of the collection.

To be clear, I have confirmed using cfdump that the ‘banana’ record does not exist in the database query that is then used to populate the Lucene collection. However, after the indexing, ‘banana’ is still there.

On a real-world example, I purged a collection containing 1500 records. I then indexed it with a query containing just 40 records. However, when running a subsequent search, the collection still contained the 1500 records from the original pre-purge state.

Does anyone know of any issues with Lucee/Lucene and purging records, or, with permissions problems with Lucene that might prevent the index from being purged?

Any help would be very much welcome!

Thanks,
Rich

I’m seeing the same behavior when trying to delete a specific item from the collection:

Lucene extension not deleting items from collection