Legacy Knowledge Base
Published Jun. 30, 2025

Entity content is too long for the configured buffer limit

Written By

Cristina Rodriguez

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • When performing a custom search such as:
    IndexSearcherHelperUtil.search(searchContext, query); 
    the following exception is thrown from Elasticsearch and no results are obtained from the search.response attribute.
    2023-03-07 11:53:04.136 ERROR [http-nio-8080-exec-72][ElasticsearchIndexSearcher:164] null
    java.lang.RuntimeException: java.io.IOException: entity content is too long [155989434] for the configured buffer limit [104857600]
    at com.liferay.portal.search.elasticsearch7.internal.search.engine.adapter.search.SearchSearchRequestExecutorImpl.getSearchResponse(SearchSearchRequestExecutorImpl.java:99) ~[?:?]
    {...}
    Caused by: org.apache.http.ContentTooLongException: entity content is too long [155989434] for the configured buffer limit [104857600]

Environment

  • Liferay DXP and Elasticsearch.

Resolution

  • This happens because Elasticsearch's buffer limit is defined to 100MB as you can see in the implementation, and the results are too big to be stored:
    // default buffer limit is 100MB
    static final int DEFAULT_BUFFER_LIMIT = 100 * 1024 * 1024;
  • To avoid getting too many results that may overflow the buffer, please add some filter to the query like groupId, companyId or some other specific attribute of the entity (such as articleId)

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base