Details
-
Bug
-
Status: Closed
-
Resolution: Fixed
-
7.0.X, 7.1.X, 7.2.X, Master
-
7.2.x, 7.1.x, 7.0.x
-
Committed
-
4
-
Search | S03 Sprint 7, Search|S03 Sprint 19|7.21-8.10
-
See PTR-1145
-
See PTR-1145
-
It is already handled by product team in PTR-1656
Description
Implemented solution
7.3 version:
- In order to solve this issue, Dynamic Data Mapping fields in Elasticsearch that start with ddm __keyword __ and ddm __text __ have been moved to a new nested document ddmFieldArray, that avoids creating new Elasticsearch mappings everytime you create a ddm field in Liferay side.
- For more information about the solution, see the breaking changes here: https://github.com/liferay/liferay-portal/blob/7.3.x/readme/BREAKING_CHANGES.markdown#dynamic-data-mapping-fields-in-elasticsearch-have-changed-to-a-nested-document
- It is possible to restore old functionality activating the "Enable Legacy Dynamic Data Mapping Index Fields." check in System Settings → Dynamic Data Mapping → Dynamic Data Mapping Indexer.
7.0, 7.1 and 7.2 versions:
- The implemented solution is included in:
- 7.2: Fixpack 8 or Service Pack 3
- 7.1: Fixpack 20 or Service Pack 5
- 7.0: Fixpack 96 or Service Pack 15 + 1.2.0 version of Elasticsearch 6 connector
- To avoid compatibility issues with existing Liferay installations, the new code will be disabled by default
- In case you want to enable it, you will have to:
- Go to System Settings → Dynamic Data Mapping → Dynamic Data Mapping Indexer
- Deactivate "Enable Legacy Dynamic Data Mapping Index Fields." check
- Execute a full reindex
If you have any custom development that execute queries in the Elasticsearch index using ddm __keyword __ and ddm __text __ fields, you will have to update your code and use the new nested ddmFieldArray document, see 7.3 version breaking changes: [https://github.com/liferay/liferay-portal/blob/7.3.x/readme/BREAKING_CHANGES.markdown#dynamic-data-mapping-fields-in-elasticsearch-have-changed-to-a-nested-document]
Elasticsearch "Limit of total fields has been exceeded" error is produced in case of having a lot of DDM Structures in the Liferay installation.
Following error is thrown in log file:
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 [7500] 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 [7500] in index [liferay-20116] has been exceeded] [Sanitized]
The root cause of the issue is every time a new DDM Structure (webcontent, forms, document library) is created, each of its DDM fields are mapped in Elasticsearch to two new field mappings for each language.
For example, in case you have a webcontent structure with 5 fields and you have 5 languages configured in your Liferay installation, in Elasticsearch side you will have:
- 5 fields * 5 languages * 2 = 50 elasticsearch mappings
Those new Elasticsearch mappings cannot be deleted until a full reindex is executed, so in case you create and delete several DDM Structures in a multi-language Liferay installation, it is easy to hit the Elasticsearch mapping limit.
Steps to reproduce
- Create a Structure with a Text field
- Create a Webcontent using that structure
- Open Elasticsearch URL http://localhost:9201/_mapping?pretty and count the number of elasticsearch mappings (check the number of occurrences of "type" in the text)
- Create a new Structure with a Text field
- Create a Webcontent using that structure
- Open Elasticsearch URL http://localhost:9201/_mapping?pretty and count the number of elasticsearch mappings (check the number of occurrences of "type" in the text)
- Expected behavior: The number of Elasticsearch mappings doesn't increase
- Wrong behavior: The number of Elasticsearch mappings increases every time you create a new structure and content
- Expected behavior: The number of Elasticsearch mappings doesn't increase
Workaround
As a workaround, it is possible to increase the Elasticsearch mapping limit, but Elastic documentation warns having a large number of mappings is a bad practice that causes throughput issues, see:
Attachments
Issue Links
- causes
-
LPS-118431 Comparison failure in DLFileEntryIndexerIndexedFieldsTest.testIndexedFields with Solr
- Closed
-
LPS-118503 Filter and sort in contentFields headless delivery API does not work
- Closed
-
LPS-123694 Custom facet no longer works with DDM fields on Elasticsearch
- Closed
-
LPS-124310 Custom filter widget no longer works with DDM fields on Elasticsearch
- Closed
-
LPS-124433 Sort widget no longer works with DDM fields on Elasticsearch
- Closed
- demands
-
LPS-104210 Update search API to better support nested fields
-
- Closed
-
-
LPS-104776 Suggest an approach for nested DDM fields with PoC in unit tests
-
- Closed
-
-
LPS-120505 Upload "mapper-extras-client" JAR versions 6.5.0, 6.8.6 and 7.3.0 to our Nexus and use on the x-branches
-
- Closed
-
-
LRDOCS-8659 Document how mappings changes can affect users of search widgets
-
- Closed
-
- is demanded by
-
LPS-101515 Default value of Indexable field setting for new structures should be configurable from System settings
- Closed
- relates
-
LPS-121941 Execute all tests in TestOrderHelper twice, setting DDMIndexerConfiguration.enableLegacyDDMIndexFields to true and false
-
- Closed
-