SearchException entity content is too long for the configured buffer limit Error for a custom entity even when Indexing Batch Sizes configuration is small
How To articles are not official guidelines or officially
supporteddocumentation. They are community-contributed content and may
not alwaysreflect the latest updates to Liferay DXP. We welcome your
feedback toimprove How to articles!
While we make every effort to ensure this Knowledge Base is accurate,
itmay not always reflect the most recent updates or official
guidelines.We appreciate your understanding and encourage you to reach
out with anyfeedback or concerns.
Legacy Article
You are viewing an article from our legacy
"FastTrack"publication program, made available for
informational purposes. Articlesin this program were published without a
requirement for independentediting or verification and are provided
"as is" withoutguarantee.
Before using any information from this article, independently verify
itssuitability for your situation and project.
Issue
- Trying to reindex a custom entity produces SearchExceptions in the logs due to a buffer limit:
com.liferay.portal.kernel.search.SearchException: java.lang.RuntimeException:
java.io.IOException: entity content is too long [134770594] for the configured buffer limit [104857600] at
com.liferay.portal.kernel.search.BaseIndexer.reindex(BaseIndexer.java:471) at
com.liferay.portal.search.internal.background.task.ReindexSingleIndexerBackgroundTaskExecutor.reindex(ReindexSingleIndexerBackgroundTaskExecutor.java:134) at
com.liferay.portal.search.internal.background.task.BaseReindexBackgroundTaskExecutor.execute(BaseReindexBackgroundTaskExecutor.java:54) at
[...]
java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.RuntimeException: java.io.IOException: entity content is too long [134770594] for the configured buffer limit [104857600] at
com.liferay.portal.search.elasticsearch7.internal.search.engine.adapter.document.BulkDocumentRequestExecutorImpl._getBulkResponse(BulkDocumentRequestExecutorImpl.java:198) at
com.liferay.portal.search.elasticsearch7.internal.search.engine.adapter.document.BulkDocumentRequestExecutorImpl.execute(BulkDocumentRequestExecutorImpl.java:68) at
com.liferay.portal.search.elasticsearch7.internal.search.engine.adapter.document.ElasticsearchDocumentRequestExecutor.executeBulkDocumentRequest(ElasticsearchDocumentRequestExecutor.java:50) at
com.liferay.portal.search.engine.adapter.document.BulkDocumentRequest.accept(BulkDocumentRequest.java:33) at
com.liferay.portal.search.engine.adapter.document.BulkDocumentRequest.accept(BulkDocumentRequest.java:25) at
com.liferay.portal.search.elasticsearch7.internal.search.engine.adapter.ElasticsearchSearchEngineAdapterImpl.execute(ElasticsearchSearchEngineAdapterImpl.java:81) at
com.liferay.portal.search.elasticsearch7.internal.ElasticsearchIndexWriter.updateDocuments(ElasticsearchIndexWriter.java:393) at
com.liferay.portal.search.internal.IndexWriterHelperImpl.updateDocuments(IndexWriterHelperImpl.java:545) at
my.own.entity.MyOwnEntityIndexer.reindexEntries(MyOwnEntityIndexer.java:151) at
my.own.entity.MyOwnEntityIndexer.doReindex(MyOwnEntityIndexer.java:120) at
com.liferay.portal.kernel.search.BaseIndexer.reindex(BaseIndexer.java:465)
... 13 more
Caused by: java.io.IOException: entity content is too long [134770594] for the configured buffer limit [104857600] at
org.elasticsearch.client.RestClient.extractAndWrapCause(RestClient.java:901) at
[...]
- The same error persists even after configuring System Settings > Search > Reindex > Indexing Batch Sizes, setting a value smaller than the default 10000:
my.own.entity.MyOwnEntityIndexer=5000
Resolution
- There are two ways to provide indexing capabilities to a custom entity:
-
com.liferay.portal.kernel.search.BaseIndexer
(older)
-
com.liferay.portal.search.internal.indexer.DefaultIndexer
(newer)
- The example above is using the older.
- The System Setting Indexing Batch Sizes is only automatically taken into account when using the newer one.
- To make sure that the configuration is taken into account with the older approach, review the reindex methods in the custom code to make sure that the
indexableActionableDynamicQuery
used to perform the reindex has an interval
set.
Did this article resolve your issue ?