Both an Issue and possible Bug Report, regarding search functionality.

Started by Douglas, January 02, 2020, 09:21:36 AM

Previous topic - Next topic

Douglas

This issue applies to both the quick search box (at the top) and the actual search page. For some reasons, underscores (_) are literally being treated as blank spaces, rather than underscores.

This is a concern that I've had for the longest time, but really haven't had a demonstrable way to show this "flaw".

I actually created a topic in the SMF 2.1 support board, centered around a weird "login_ssl_required" message I hadn't seen before. It took me almost an hour of searching around SMF before I even got a hint of what to look for.

Because "login_ssl_required" has underscores in it, search was returning everything and anything BUT what I was searching for... even when I used login_ssl_required with and without quotes, for both the quick search and actual search.

There is no reason, when searching for that phrase (underscores included) that this thread (and others) should not show up.

It's not just that phrase... there's several searches I've done in the past with various SMF functions that have underscores that don't get returned in search results, because of the "underscore > spaces" issue.

What I would suggest is that the search system be updated to have an "exact phrase" option, that also factors in underscores. Right now, the search option is "Match All Words" and "Match Any Words".  Even phpMyAdmin has an exact phrase option:
Quoteat least one of the words
all of the words
the exact phrase as substring
the exact phrase as whole field
as regular expression

Thanks!
Doug Hazard
* Full Stack (Web) Developer for The Catholic Diocese of Richmond
(20+ Diocesan sites, 130+ Church sites & 24 School sites)
* Sports Photographer and Media Personality
* CFB Historian
* Tech Admin for one 1M+ post, one 2M+ post and one 10M+ post sites (last two are powered by multiple servers)
* WordPress Developer (Junkie / Guru / Maven / whatever)

Illori

does this issue happen in a normal SMF install without sphinx being used?

SleePy

Only did some basic tests but from what I see the search should return that topic and this one.  But I checked the search index directly here.  So I'm not sure if SMF or Sphinx API is the one doing this. I'm guessing something is telling it to convert underscores into spaces and thats what is giving you all these results.
Will look into this when I get more time.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Douglas

Quote from: Illoridoes this issue happen in a normal SMF install without sphinx being used?
To be fair, I wasn't aware SMF was using Sphinx (kind of shows how out of date I am, huh? ;) ). Since this may be specific to SMF's forums (here), itself, I didn't check on other SMF forums I have access to. The underscores on those sites aren't anywhere as crucial as they are on here.

Quote from: SleePyOnly did some basic tests but from what I see the search should return that topic and this one.  But I checked the search index directly here.  So I'm not sure if SMF or Sphinx API is the one doing this. I'm guessing something is telling it to convert underscores into spaces and thats what is giving you all these results. Will look into this when I get more time.
Thank ya, Sir!
Doug Hazard
* Full Stack (Web) Developer for The Catholic Diocese of Richmond
(20+ Diocesan sites, 130+ Church sites & 24 School sites)
* Sports Photographer and Media Personality
* CFB Historian
* Tech Admin for one 1M+ post, one 2M+ post and one 10M+ post sites (last two are powered by multiple servers)
* WordPress Developer (Junkie / Guru / Maven / whatever)

SleePy

Should be good to go now.  Was a API bug.

We use Sphinx.  You ran/run some large forums and know how MySQL can kill with fulltext index searches.  Its a recommendation for big boards to switch to Sphinx as it handles searches better than MySQL can.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Advertisement: