You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Mridul Pathak (Jira)" <ji...@apache.org> on 2026/10/19 15:43:00 UTC

[jira] [Created] (OFBIZ-13698) A database error while indexing deletes the product or content from the Lucene index

Mridul Pathak created OFBIZ-13698:
-------------------------------------

             Summary: A database error while indexing deletes the product or content from the Lucene index
                 Key: OFBIZ-13698
                 URL: https://issues.apache.org/jira/browse/OFBIZ-13698
             Project: OFBiz
          Issue Type: Bug
          Components: lucene
    Affects Versions: 24.09.07, Upcoming Branch
            Reporter: Mridul Pathak
            Assignee: Mridul Pathak


h3. Problem
{{ProductDocument.prepareDocument()}} and {{ContentDocument.prepareDocument()}} log and swallow entity and rendering exceptions and return {{null}}, and {{DocumentIndexer.run()}} treats a {{null}} document as a removed record and calls {{indexWriter.deleteDocuments()}}. Any transient database error while indexing therefore silently removes the product or content from the Lucene index.

{code:java}
} catch (GenericEntityException e) {
    Debug.logError(e, MODULE);
}
return null; // DocumentIndexer then deletes the document from the index
{code}

h3. Fix
{{LuceneDocument.prepareDocument()}} needs to throw when the document cannot be prepared, keeping {{null}} for "remove from the index", and {{DocumentIndexer}} needs to log and skip such a document, leaving the index unchanged. Applies to trunk and release24.09.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)