Issue
When new contents are created or updated in Liferay, they are not being added to the Elasticsearch index (they will not be displayed on the search results)
If you check the log Liferay log file you will get this "Limit of total fields [7500] in index [liferay-20115] has been exceeded" error message:
- 7.0 and 7.1 versions:
2019-01-24 19:01:49.069 ERROR [liferay/search_writer/SYSTEM_ENGINE-423][ElasticsearchUpdateDocumentCommandImpl:50] failure in bulk execution:_[1]: index [liferay-20116], type [LiferayDocumentType], id [com.liferay.journal.model.JournalArticle_PORTLET_2557174], message [java.lang.IllegalArgumentException: Limit of total fields [10000] in index [liferay-20116] has been exceeded]_[3]: index [liferay-20116], type [LiferayDocumentType], id [com.liferay.journal.model.JournalArticle_PORTLET_2556975], message [java.lang.IllegalArgumentException: Limit of total fields [10000] in index [liferay-20116] has been exceeded] [Sanitized]
- 7.2 version:
2022-10-02 13:52:14.886 ERROR [http-nio-8080-exec-89][BulkDocumentRequestExecutorImpl:53] failure in bulk execution:_[1]: index [liferay-20115], type [LiferayDocumentType], id [com.liferay.journal.model.JournalArticle_PORTLET_234543], message [java.lang.IllegalArgumentException: Limit of total fields [7500] in index [liferay-20115] has been exceeded]_[3]: index [liferay-20115], type [LiferayDocumentType], id [com.liferay.journal.model.JournalArticle_PORTLET_234530], message [java.lang.IllegalArgumentException: Limit of total fields [7500] in index [liferay-20115] has been exceeded] [Sanitized]
This error is thrown when the Elasticsearch server has reached the index limit for the maximum total fields, this article provides a solution to this error.
Environment
- Liferay DXP 7.0
- Liferay DXP 7.1
- Liferay DXP 7.2
Resolution
- This problem is solved by https://issues.liferay.com/browse/LPS-103224
- You have to install a hotfix or fix pack that includes the LPS-103224 correction and enable it:
- Check that your Liferay installation has LPS-103224 fix applied
- Go to System Settings → Dynamic Data Mapping → Dynamic Data Mapping Indexer
- Deactivate "Enable Legacy Dynamic Data Mapping Index Fields." check
- Execute a full reindex
- Important: Enabling this LPS causes a breaking change to custom developments, for more information, see:
-
As a workaround: in case you cannot apply that LPS, you can change Elasticsearch mapping limit, but it could affect the Elasticsearch throughput:
- Add index.mapping.total_fields.limit: <value> to the "Additional Index Configurations" property of the Elasticsearch entry in the System Settings. This requires you perform a full reindex!