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

Lucene search - It is not possible to sort queries by localized title

    Details

    • Branch Version/s:
      6.1.x
    • Backported to Branch:
      Committed
    • Story Points:
      4

      Description

      Add two journal articles with spanish translation.

      In a portlet, try to sort with this code:

      final Query query = TermQueryFactoryUtil.create(searchCtx, "entryClassName", "com.liferay.portlet.journal.model.JournalArticle" );

      final Sort sort = SortFactoryUtil.getSort(JournalArticle.class, "title_es_ES", "asc");

      final Hits hits = SearchEngineUtil.search(SearchEngineUtil.SYSTEM_ENGINE_ID, company.getCompanyId(), query, sort,
      0, Integer.MAX_VALUE);

      Problem: the field title_es_ES is tokenized, so it isn't possible to sort by this field. However, In 6.2.x, we added a copy of the title field not tokenized, that is used to sorting purposes.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mark.jin Mark Jin (Inactive)
                Reporter:
                victor.miranda Victor Miranda (Inactive)
                Participants of an Issue:
                Recent user:
                Esther Sanz
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  6 years, 40 weeks ago

                  Packages

                  Version Package
                  6.1.30 EE GA3