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

Make Basic and Advanced searches for Journal Articles able to add the right localized fields to the queries



      1. No current display locale is passed to the SearchContext

      • Consider a Web Content
      • "en_US" as default_locale
      • A new translation (e.g. "el_GR") for this WC
      • Fields stored with localized postfixes:
        • content, content_en_US, content_el_GR
        • description, description_en_US, description_el_GR
        • title, title_en_US, title_el_GR
      • In the asset_search_results.jspf, any of the 2 possible searches (basic, advanced) gets the display Locale
      • When a new SerachContext is being instantiated, its locale field will be filled up with the portal's default locale by default (e.g. en_US)

      --> Despite the user changes the display locale to el_GR, the search query will contain the following localized fields for Web Contents:
      content_en_US, description_en_US, title_en_US

      Conclusion: we should change the signatures of the corresponding search methods of AssetEntryLocalService in order to pass the current display locale to the SearchContext. The SearchContext has to contain the current display locale to create the right queries

      2. Advanced searches never contain localized fields

      • There are 3 attributes added to the SearchContext at advanced search: title, description, username
      • Keywords are not passed to the SC at advanced search
      • The localized fields of a WC are added to the searchQuery by the JournalIndexer.postProcessSearchQuery() method: it tries to add the content, description, title fields to the query as localized terms by invoking the BaseIndexer.addSearchLocalizedTerm() method (which goes to the addSearchTerm() method).

      --> The current logic of the addSearchTerm() never adds the localized fields to the advanced search queries, which obviously incorrect behavior for Web Contents, mainly when the current display locale is not the default.
      Reason: these localized fields are not attributes of the given SC, no keywords passed --> Code returns without adding the field


          Issue Links



              justin.choi Justin Choi (Inactive)
              tibor.lipusz Tibor Lipusz
              Participants of an Issue:
              Recent user:
              Marta Elicegui
              0 Vote for this issue
              0 Start watching this issue


                Days since last comment:
                8 years, 15 weeks, 1 day ago


                  Version Package
                  6.1.1 CE GA2
                  6.1.20 EE GA2
                  --Sprint 11/12
                  6.2.0 CE M2