This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-0db63ed1-14bb-4879-86de-d7de47dcc391 XWIKI-22949 Open

Solr index synchronization on startup doesn't remove deleted objects, object properties or attachments

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-717fef34-3338-4db5-8ffd-83ed83de55b7 Michael Hamann created this issue on 03/Mar/25 17:22
 
Summary: Solr index synchronization on startup doesn't remove deleted objects, object properties or attachments
Issue Type: cid:jira-generated-image-avatar-0db63ed1-14bb-4879-86de-d7de47dcc391 Bug
Affects Versions: 14.10
Assignee: Unassigned
Attachments: image-2025-03-03-17-18-39-080.png
Components: Search - Solr
Created: 03/Mar/25 17:22
Priority: cid:jira-generated-image-static-major-311956eb-7c69-4543-bb35-cc7158a3ce94 Major
Reporter: Michael Hamann
Description:

Steps to reproduce:

  1. Create a document and add a comment on it with some unique word in it.
  2. Delete the comment while preventing the Solr index to be updated. A way is to attach a debugger and put a break point org.xwiki.search.solr.internal.SolrIndexEventListener#onEvent and to prevent the execution of the listener by doing a "force return" whenever the method is called. Another way could be to unregister this event listener.
  3. Restart XWiki.

Expected result:

On startup, a message "IndexerJob         - 0 documents
added, 0 deleted and 1 updated during the synchronization of the Solr index." is logged and when searching for the unique word without "Result type" filter, no documents are found.

Actual result:

While the message is logged as expected, the object can still be found in the Solr search:

43380_image-2025-03-03-17-18-39-080.png

This is because the synchronization on startup only compares documents and not object or object properties. While it triggers a recursive update of the documents, this update doesn't delete anything so objects and properties that don't exist anymore in the database aren't removed from the index.