You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2026/10/19 15:58:00 UTC
[jira] [Commented] (OFBIZ-13698) A database error while indexing deletes the product or content from the Lucene index
[ https://issues.apache.org/jira/browse/OFBIZ-13698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18128824#comment-18128824 ]
ASF subversion and git services commented on OFBIZ-13698:
---------------------------------------------------------
Commit 8f6d60a628412b92bf095fce0e632ce7d98d3ba3 in ofbiz-plugins's branch refs/heads/trunk from Mridul Pathak
[ https://gitbox.apache.org/repos/asf?p=ofbiz-plugins.git;h=8f6d60a62 ]
Fixed: A database error while indexing deletes the product or content from the Lucene index (OFBIZ-13698)
ProductDocument and ContentDocument returned null when the record could not be read, which DocumentIndexer took as a removed record, deleting its document from the index. prepareDocument() now throws when the document cannot be prepared, and DocumentIndexer logs the error and leaves the index unchanged for that record.
> 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: Upcoming Branch, 24.09.07
> Reporter: Mridul Pathak
> Assignee: Mridul Pathak
> Priority: Major
>
> 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)