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

An indexer available before its model document contributor can result in documents without fields

    Details

      Description

      Indexers can be available before a corresponding model document contributor (MDC) is active. As a result, these indexers can index documents without the relevant fields. It happens a bunch of times with portal instance lifecycle listeners, which often are running in a state where the indexer is available, but not the MDC.

      Steps to reproduce

      This behavior is sometimes the root cause of bugs such as LPS-96294 and LPS-89026.

      Workaround

      If you are having problems because your code uses an indexer before an MDC is available, you can add a reference to the MDC into the corresponding search registrar. This way, the registrar will only be active once the MDC is available.

      References

      We have an integration test that reproduces this behavior in https://github.com/vagnerbc/liferay-portal/blob/13d8a7bb3f386141069badcf5792b7463c7f5d0e/modules/apps/company/company-test/src/testIntegration/java/com/liferay/company/search/test/DefaultDDLStructuresPortalInstanceTest.java#L183

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                support-lep@liferay.com SE Support
                Reporter:
                adam.brandizzi Adam Brandizzi
                Participants of an Issue:
                Recent user:
                Balázs Sáfrány-Kovalik
                Engineering Assignee:
                Adam Brandizzi
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Days since last comment:
                  18 weeks, 3 days ago

                  Packages

                  Version Package