Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-119531

Changing "Index Name Prefix" system setting configuration may result in index with incorrect mappings

    Details

    • Fix Priority:
      3

      Description

      Taken from this comment:

      There are several ways to end having a index with the "wrong mappings" issue.
      This issue is caused because during a index operation Elasticsearch autocreates the index in case it doesn't exists and infers mappings configuration from incoming data, but Liferay needs some specific mapping configuration.

      1. Cannot change Elasticsearch "Operation Mode" and "Index Name Prefix" in the same time:
      2. If you change "Index Name Prefix", index creation is not triggered.
        • (same problem than previous point) As index is not created, in case a index request is send to Elasticsearch server (for example after a webcontent update) the autocreation of the index will be triggered, but without any mapping configuration, so you will end having the "wrong mappings" issue

      As a workaround, you can solve all issues executing a full reindex.


      Steps to reproduce:

      1. Start up Portal connected to a remote Elasticsearch engine
      2. Navigate to Control Panel > Configuration > System Settings > Search > Elasticsearch (version number)
      3. Update the Index Name Prefix (e.g. change liferay- to liferaytest-)
      4. Navigate to http://localhost:9200/_cat/indices
        Expected result: A Liferay company index with the new prefix is present appearing as liferaytest-<company ID>
        Actual result: Index with the new prefix is not created.
      5. Create a web content article
      6. Navigate to http://localhost:9200/_cat/indices
      7. Observe liferaytest-<company ID> is now created
      8. Navigate to http://localhost:9200/liferaytest-<company ID>/_mapping
      9. Check "entryClassName" mapping
        • Expected mapping: "type":"keyword","store":true 
        • Actual mapping: "type":"text","fields":{"keyword": {"type":"keyword","ignore_above":256 

      Workaround: Perform a full-reindex to recreate the index with the correct mapping. 

      Reproduced on:
      Portal master (7.3.x) git commit: 7bc1c72cd85610f3ff4e220f6e51c6deb8ce2828
      Portal DXP 7.2.10.1 SP1
      Portal DXP 7.1.10 GA1
      Portal DXP 7.0.10.12 SP12

        Attachments

          Activity

            People

            Assignee:
            support-lep@liferay.com SE Support
            Reporter:
            joshua.chong Joshua Chong
            Participants of an Issue:
            Recent user:
            Tibor Lipusz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              1 year, 4 weeks ago

                Packages

                Version Package