Search on 2-char Tags

- Search on 2-char Tags
-
Junior Member
Search on 2-char Tags
When a user does a search for something that is less than 3 characters, Pligg says "no results found." I'm guessing there's logic in there to enforce a minimum of 3 chars. Unfortunately, I have tags for states like "nh" and when a user clicks on those tags, they get "no results". Does anyone know where this setting is?
Thanks!
-
Moderator
There's most likely not a setting for this, but you need to adjust the sourcecode if you want to allow short tags like that.
-
Senior Member
I'm not sure but I think it's a limitation/restriction in MySQL, see Change the full text index minimum word length with MySQL and Fine-Tuning MySQL Full-Text Search -default minimum value is four characters.
Also, you can go to Admin > Configure > Misc > Search Method and you can choose what method you want to use. Maybe altering the search method will give you a result for two chars.
-
Junior Member
Thanks for the response. I was looking through the source code. I'm not looking for MySQL to do a fulltext search on 2-char, but I'd like to still match the tags for 2-char tags. I found where the setting is.
In search.php, line 101
if(strlen($search->searchTerm) < 3 && strlen($search->url) < 3 && !$search->s_date)
Change the first 3 to a 2
if(strlen($search->searchTerm) < 2 && strlen($search->url) < 3 && !$search->s_date)
Uploaded this change, and now search works for matching 2-char tags.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules