Lucene extension not deleting items from collection

I’m having an issue with the Lucene extension not actually deleting items from an index. I know this extension is pretty old, but I’m working on converting some legacy code from ACF to Lucee and trying to at least use the Lucene extension temporarily until we can re-write the search code.

I’ve tried various versions of the extension (2.4.1.33-SNAPSHOT, 2.4.1.32 and even rolled back to 2.4.1.28) and none of them work.

Here’s my current

OS: CentOS 7/Linux (3.10.0-1127.19.1.el7.x86_64) 64bit
Java Version: 11.0.8 (N/A) 64bit
Tomcat Version: Apache Tomcat/9.0.37
Lucee Version: Lucee 5.3.6.61

Here’s an example script that shows off the issue. I would expect the item to after deleting the item, but the search still shows the item exists. I’ve even tried adding a long sleep statement after the delete to see if the item disappears, but it doesn’t seem to help. I’ve even tried restarting Tomcat to see if there’s a cache issue at play, but the item still exists after restarting Tomcat. It would appear the delete code just is not properly removing the item from the collection.

<cfscript>
	collectionName="__test__";
	collectionsPath="/path/to/collections/";
	collectionLanguage="english";

	// test data row
	recordToIndex = {
		  itemId=1
		, key="c|1"
		, title="My Test Title"
		, text="Example text"
		, keywords="hello,goodbye"
		, categoryName="My Category"
		, keywordList="hello,goodbye"
	};
</cfscript>

<!---// try to delete the test collection if it exists //--->
<cftry>
	<cfcollection
		action="delete"
		collection="#collectionName#"
	/>

	<cfcatch type="any">
		<!---// do nothing //--->
	</cfcatch>
</cftry>

<!---// create the collection //--->
<cfcollection
	action="create"
	collection="#collectionName#"
	path="#collectionsPath#"
	categories="false"
	language="#collectionLanguage#"
/>

<!---// add the test item to the collection //--->
<cfindex
	collection="#collectionName#"
	action="update"
	type="custom"
	key="#recordToIndex.key#"
	title="#recordToIndex.title#"
	body="#recordToIndex.title# #recordToIndex.text# #recordToIndex.keywords#"
	language="#collectionLanguage#"
	custom1="#recordToIndex.itemId#"
	custom2="customer"
	custom3="database"
/>

<!---// validate the item has been added //--->
<cfsearch
	name="searchResults"
	type="simple"
	collection="#collectionName#"
	criteria="*"
	suggestions="never"
/>

<cfdump var="#searchResults#" />

<!---// delete the item from the collection //--->
<cfindex
	action="delete"
	collection="#collectionName#"
	key="#recordToIndex.key#"
/>

<!---// test to see if the item has been removed from the collection //--->
<cfsearch
	name="searchResults"
	type="simple"
	collection="#collectionName#"
	criteria="*"
	suggestions="never"
/>

<cfdump var="#searchResults#" />

Am I missing something obvious or some required step?

I’m wondering if this isn’t related to this post:

https://lucee.daemonite.io/t/lucee-lucene-purging-issue/7089