Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-84703 Multi Language Search for WCM
  3. LPS-88225

Return highlighting snippets for all matching translations regardless of display language

    Details

    • Type: Technical Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Completed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Sprint:
      Search | S02 Sprint 1, Search | S02 Sprint 3, Search | S02 Sprint 4, Search | S02 Sprint 5, Search | S02 Sprint 6, Search | S02 Sprint 7, Search | S02 Sprint 8, Search | S02 Sprint 9, Search | S02 Sprint 10, Search | S02 Sprint 11, Search | S02 Sprint 12, Search | S02 Sprint 13

      Description

      This Story implements logic that allows several languages to be targeted in the same search for Journal Articles; and search engine results must return “multi language snippets” (like `snippet_content_en_US` or `snippet_content_pt_BR`) for all languages potentially matching.

      However, currently we build a highlighting request that targets only one locale:

      https://github.com/liferay/liferay-portal/blob/234fb27096915a0a489581e28bafb5be3d73b1d8/modules/apps/portal-search-elasticsearch6/portal-search-elasticsearch6-impl/src/main/java/com/liferay/portal/search/elasticsearch6/internal/highlight/DefaultHighlighterTranslator.java#L44

      Visually, this can be noticed when searching from the Liferay Search Page with results displayed in Document Form. There will be no snippet field for languages other than current display language; so no yellow highlight even if there's a matching word in other translations.

      Breaks tests:

      `com.liferay.journal.search.test.JournalArticleMultiLanguageSearchSummaryTest`

      `testBrContentUntranslatedHighlightedTranslatedPlain`

      `org.junit.ComparisonFailure: expected:<...e great for telling [<liferay-hl>time</liferay-hl>]> but was:<...e great for telling [time]>`

      `testBrDescriptionUntranslatedHighlightedTwiceTranslatedPlain`

      `org.junit.ComparisonFailure: expected:<On clocks and [<liferay-hl><liferay-hl>time</liferay-hl></liferay-hl>]> but was:<On clocks and [time]>`

      Tests break because in `SearchContext` (and its `QueryConfig`) the only locale is BRAZIL, therefore only snippet fields like `snippet_content_pt_BR` are requested from the search engine.

      `HighlighterTranslator` currently takes a list of base names and a single locale; it probably needs to receive a list of fully resolved field names instead.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                48 weeks, 5 days ago

                Packages

                Version Package