philomena-dev / philomena

Next-generation imageboard
GNU Affero General Public License v3.0
84 stars 29 forks source link

Searching for query that includes brackets and using wildcard * gives no results. #149

Closed HushedFox closed 2 years ago

HushedFox commented 2 years ago

Describe the bug When trying to search for a query that has brackets and also using wildcard * in it gives no results. This problem is especially severe on Furbooru as there are lots of tags that have brackets in them.

To Reproduce Steps to reproduce the behavior:

  1. Go to image search: https://derpibooru.org/search
  2. Type twilight sparkle (a*
  3. See that there are no results, but there is a tag twilight sparkle (alicorn) that should be shown here

The same can be seen here, in tag search:

  1. Go to tag serach: https://derpibooru.org/tags
  2. Type twilight sparkle (a*
  3. See that there are no results, but there is a tag twilight sparkle (alicorn) that should be shown here

Expected behavior Wildcard should work and there should be results for matching tags.

Screenshots On Derpibooru there is a tag called twilight sparkle (alicorn) image When I try to search for it there are no results, image search: image tag search: image

liamwhite commented 2 years ago

This is not no results, this is a parse error. To search for expressions with imbalanced parentheses, you must either escape or quote the term:

HushedFox commented 2 years ago

I think I remember it working fine in the past, but maybe I am mistaken.

But anyway, this is not a good behavior from the perspective of the user. There is no information provided on the search page directly about how to search with brackets so that results are properly displayed, it's only explained in the long search syntax documentation. In the very least if such problem is encountered it should inform the user about how to search for intended thing, but the ideal solution would be to change user input of this kind into proper query. The site should assume that input twilight sparkle (a* is equal to the ones you provided and show results for that instead.

On Furbooru every character tag has brackets in its name, so it's kind of important for such things to be user friendly... image