plone / Products.CMFPlone

The core of the Plone content management system
https://plone.org
GNU General Public License v2.0
243 stars 186 forks source link

Catalog search does not handle correctly parenthesis inside quotes #3879

Closed erral closed 8 months ago

erral commented 8 months ago

BUG/PROBLEM REPORT (OR OTHER COMMON ISSUE)

What I did:

What I expect to happen:

What actually happened:

What version of Plone/ Addons I am using:

mauritsvanrees commented 8 months ago

Let me check. I have created a Plone 6.0 site with two pages, one with title "Hello World Plain" and one with "Hello (World) Parentheses". In the SearchableText and Title indexes, the parentheses are stripped away, so they only have ['hello', 'world', 'parentheses'] or similar.

Now I try it with your branch. There is no change, except in the last one, where munge_search_term correctly gives "hello (world)", and we find both pages.

So looks good to me. Thanks! Same for your plone.app.querystring PR.

I wonder if we could instead simply add the parentheses to BAD_CHARS, as they are ignored anyway, but they are not exactly "bad" characters, just a bit annoying. ;-). So let's leave that as it is.