Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Adjusting the four character limit for a functional search
Avatar
Angus
Member
sp_UserOfflineSmall Offline
Mar 21, 2016 - 5:46 am

We use a lot of acronyms in our industry so the four character minimum on search terms makes many of our key topics impossible to search for - can this limit be adjusted? I understand there may be a performance hit but I'm prepared to make that compromise for a useful search function.   

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Mar 21, 2016 - 6:02 am

I am sorry to say that this is not something that is under either Simple:Press or WordPress control. It is a setting on your mySQL database and to change it will need the help of your hosting support.

To be perfectly honest I have no idea whether they will be willing to change it or not. I would have thought they would be with the right argument but I would be interested to know how they respond to the request.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Mar 21, 2016 - 8:12 pm

if you have access to  your mysql ini file on your server you could change it as well... more info:  http://dev.mysql.com/doc/refma.....uning.html

Avatar
Angus
Member
sp_UserOfflineSmall Offline
Mar 22, 2016 - 11:38 am

Thanks, I understand we can't leverage a FULLTEXT index with strings shorter than the mySQL minimum, but that doesn't make searching for shorter strings impossible, just slow. Wordpress has no problem searching for three letter words - can Simple:Press do something similar, as fallback maybe?

== UPDATE ==

After research I can see that by editing the query directly...

/forum/?search=1&value=ABC

...the search works fine with strings of any length, including words shorter than the mySQL minimum. So the only thing preventing a search for short words is restrictive js validation. Unfortunately the script that does that (sp-forum.js) is obfuscated - is there a hook to tweak the validation? Or a way to remove it altogether? We really don't need min-length validated at all.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Mar 22, 2016 - 1:01 pm

You know i had completely forgotten that we had removed our fulltext index on post content. So you are quite right.

It's going to need a little coding to get it up and working as it should but it will be done ASAP

andy-signature.png
YELLOW
SWORDFISH
Avatar
Angus
Member
sp_UserOfflineSmall Offline
Mar 23, 2016 - 6:34 am

Thanks Yellow, that's great news. Should I watch this thread for updates?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Mar 23, 2016 - 7:08 am

It will be in the next update to Simple:Press which is due for release at the same time as WordPress 4.5 which is currently at Beta 4 and seems  to be progressing nicely.

We are imposing a limit of 3 characters by default as really all recommendations are never to search on less. But this can be overridden by a user if they really feel they need to.

andy-signature.png
YELLOW
SWORDFISH
Avatar
jim
Here and Now
Member
Pro Subscribers
sp_UserOfflineSmall Offline
Jan 12, 2017 - 8:52 pm

Yellow Swordfish said
We are imposing a limit of 3 characters...But this can be overridden by a user... 

Exactly how?

I'm excited to hear this is possible and would like to explain, since we're getting a lot of new members with three legged cats. I just confirmed that I can search for "cat" but presume the results also return words containing cat like catapult, catacomb or truncate.

FYI: The warning notice only appeared when I searched for " cat " (including the spaces), but the search still returned 7,750+ results—hence my presumption above.

I thought I saw a note somewhere about wildcard characters that could be used in the search query, but can't find that now.

Thanks in advance for any feedback!

catsearch.jpgImage Enlarger

TripawdsSimple:Press powers the Tripawds Discussion Forums.

It's better to hop on three legs than to limp on four.

The Tripawds Blogs Community is made possible by The Tripawds Foundation.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jan 12, 2017 - 9:05 pm

you have to adjust your mysql settings...  something like this (dont worry about 5.7 ref):  http://dev.mysql.com/doc/refma.....uning.html

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jan 12, 2017 - 9:16 pm

oh wait... lol... was doing the full text search thing like Andy...oops...

in your theme spFunctions.php file, just add this with desired value:

define('SPSEARCHMIN', 3);

of course, be sure you have a child theme or a custom theme and not editing one of ours...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626