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

Search results - summaries prefer document content over snippets

    Details

      Description

      When the WIKI page content is searched, the final result search items summaries contain beginnings of articles. In this summaries the search term may not occur at all. Analyzing the code I've found that although the snipped is returned from indexer, it is finally never used because of faulty condition.

      I've changed main_search_result_form.jsp following way, which works for me:
      if (assetRenderer != null) {
      entryTitle = assetRenderer.getTitle(locale);
      if (className.equals("com.liferay.portlet.wiki.model.WikiPage"))

      { entrySummary = document.get(Field.SNIPPET); }

      else

      { entrySummary = StringUtil.shorten(assetRenderer.getSummary(locale), 200); }

      }

      It could be probably generalized somehow. Maybe there is a better fix.

        Attachments

        1. 6.1.reproduced.png
          6.1.reproduced.png
          47 kB
        2. actual.jpg
          actual.jpg
          422 kB
        3. expect.jpg
          expect.jpg
          52 kB
        4. fail.png
          fail.png
          39 kB

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  4 years, 30 weeks, 4 days ago

                  Packages

                  Version Package
                  6.2.X EE
                  7.0.0 Alpha 1