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

Search Logic - Stop words (eg: "the", "is" and "are") are removed from the search text even when surrounded with quotation marks

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Won't Fix
    • Affects Version/s: 5.1.2, 5.2.3, 6.0.0 Preview
    • Fix Version/s: 5.1.2, 5.2.3, 6.0.0 Preview
    • Component/s: None
    • Labels:
      None
    • Environment:
      All
    • Branch Version/s:
      5.2.x, 5.1.x

      Description

      Search Logic - Stop words (eg: "the", "is" and "are") are removed from the search text even when surrounded with quotation marks

      To reproduce, in the Search Portlet search for:
      "Save the rainforest"

      The actual search will search for the term:
      "Save rainforest"

      The reason is that in all the .search(...) methods (DLLocalServiceImpl.search, JournalArticleLocalServiceImpl.search, etc), we add the keywords like this:

      if (Validator.isNotNull(keywords))

      { searchQuery.addTerm(Field.CONTENT, keywords); searchQuery.addTerm(Field.PROPERTIES, keywords); searchQuery.addTerm(Field.TAGS_ENTRIES, keywords); }

      and the method "addTerm" will strip out those filler words. if we add the term via the method "addExactTerm", then the filler words will be preserved. What we need to do is make modifications so that if a phrase is surrounded by quotation marks, it will be added via "addExactTerm" and if its not surrounded by quotation marks.. then we should add the term via "addTerm"

      (Updated on 7/10)
      It seems that the better way to address this may be to go into the logic of the "addTerm" method in BooleanQueryImpl.java.. and change the logic to automatically handle phrases.

      Scott

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              support-lep@liferay.com SE Support
              Reporter:
              scott.lee Scott Lee
              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:
                11 years, 30 weeks, 3 days ago

                  Packages

                  Version Package
                  5.1.2
                  5.2.3
                  6.0.0 Preview