Details

    • Type: Technical Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Completed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Search Infrastructure
    • Labels:
      None

      Description

      Replicate the bug in a new unit test class for CommonSearchRequestBuilderAssemblerImpl (currently there's none).

      Ideally:

      com.liferay.portal.search.elasticsearch6.internal.search.engine.adapter.search.CommonSearchRequestBuilderAssemblerImplTest

      It is worth noting CommonSearchRequestBuilderAssemblerImpl is already instantiated as part of other unit tests:

      https://github.com/liferay/liferay-portal/blob/90236f1339c0bc36b3b07ba25055f30bda99b3cb/modules/apps/portal-search-elasticsearch6/portal-search-elasticsearch6-impl/src/test/java/com/liferay/portal/search/elasticsearch6/internal/search/engine/adapter/search/SearchRequestExecutorFixture.java#L118-L141

      However for the purpose of replicating LPS-98297 in a unit test, ideally a smaller instance can be enough. Specifically, the circumstances of this bug should not require the sub components that handle facets, aggregations or stats.

      Instantiating CommonSearchRequestBuilderAssemblerImpl directly, and invoking assemble, will operate directly on an Elasticsearch SearchRequestBuilder object. See these test classes for general reference on how to interact directly with Elasticsearch from unit tests:

      https://github.com/liferay/liferay-portal/blob/90236f1339c0bc36b3b07ba25055f30bda99b3cb/modules/apps/portal-search-elasticsearch6/portal-search-elasticsearch6-impl/src/test/java/com/liferay/portal/search/elasticsearch6/internal/query/SearchAssert.java#L88-L94

      https://github.com/liferay/liferay-portal/blob/90236f1339c0bc36b3b07ba25055f30bda99b3cb/modules/apps/portal-search-elasticsearch6/portal-search-elasticsearch6-impl/src/test/java/com/liferay/portal/search/elasticsearch6/internal/document/SingleFieldFixture.java#L41-L44

      https://github.com/liferay/liferay-portal/blob/90236f1339c0bc36b3b07ba25055f30bda99b3cb/modules/apps/portal-search-elasticsearch6/portal-search-elasticsearch6-impl/src/test/java/com/liferay/portal/search/elasticsearch6/internal/index/LiferayTypeMappingsPrefixPerLanguageTest.java#L36-L42

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  8 weeks, 2 days ago

                  Packages

                  Version Package