Uploaded image for project: '[Read Only] - Hippo Site Toolkit 2'
  1. [Read Only] - Hippo Site Toolkit 2
  2. HSTTWO-3680

[Backport 3.2] SearchInputParsingUtils should not allow "-" and "!" at the end of search input

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 3.2.2
    • None
    • None
    • Flagged
    • Platform sprint 130, Platform sprint 131

    Description

      org.hippoecm.hst.util.SearchInputParsingUtils#parse should clean up "-" and "!" as separate and last search term

      Reproduction:

      • install the Essentials Search feature
      • drag & drop search box on home page
      • set debug level to EssentialsListComponent
      • search for lorem ! or lorem -

      Result is this stack trace

      [INFO] [talledLocalContainer] 09.02.2016 14:55:57 DEBUG http-nio-8080-exec-10 [EssentialsListComponent.doSearch:166] Query exception:
      [INFO] [talledLocalContainer] org.hippoecm.hst.content.beans.query.exceptions.QueryException: Exception building query: org.apache.lucene.queryParser.ParseException: Cannot parse 'lorem -': Encountered "<EOF>" at line 1, column 7.
      [INFO] [talledLocalContainer] Was expecting one of:
      [INFO] [talledLocalContainer]     "(" ...
      [INFO] [talledLocalContainer]     "*" ...
      [INFO] [talledLocalContainer]     <QUOTED> ...
      [INFO] [talledLocalContainer]     <TERM> ...
      [INFO] [talledLocalContainer]     <PREFIXTERM> ...
      [INFO] [talledLocalContainer]     <WILDTERM> ...
      [INFO] [talledLocalContainer]     "[" ...
      [INFO] [talledLocalContainer]     "{" ...
      [INFO] [talledLocalContainer]     <NUMBER> ...
      [INFO] [talledLocalContainer]     <TERM> ...
      [INFO] [talledLocalContainer]     "*" ...
      [INFO] [talledLocalContainer]
      [INFO] [talledLocalContainer]
      [INFO] [talledLocalContainer]   at org.hippoecm.hst.content.beans.query.HstQueryImpl.execute(HstQueryImpl.java:308)
      [INFO] [talledLocalContainer]   at org.onehippo.cms7.essentials.components.EssentialsListComponent.executeQuery(EssentialsListComponent.java:260)
      [INFO] [talledLocalContainer]   at org.onehippo.cms7.essentials.components.EssentialsListComponent.doSearch(EssentialsListComponent.java:162)
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              aschrijvers Ard Schrijvers
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: