Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
Tagged: 8.4.1, filter, search, stop words, wp_search_stopwords
- This topic has 6 replies, 2 voices, and was last updated 8 years ago by
Steven Zahm.
-
AuthorPosts
-
08/27/2015 at 5:19 pm #344692
Charles McPadden
ParticipantI have Connections 8.4.1 installed (with Tile Plus 4.1). Today, I noticed I can’t locate a specific user in my directory. His first name is Will. If I search by his first name (Will), he IS NOT found. If I search by his last name, he IS found. If I change his first name to William, I can find him by first name lookup. All other users can be found via first name or last name lookup. I have also tried using uppercase and lowercase searches. It doesn’t seem to have any bearing on things. To my knowledge, this issue seems to be limited to this one individual.
Thanks in advance for any assistance you may provide.
Charles
08/27/2015 at 7:40 pm #344697Steven Zahm
Keymaster@ Charles
Looking back thru your various posts… I came across one asking about a notice you received when upgrading basically stating that the table indices do not support FULLTEXT. For a refresher here’s the thread:
http://connections-pro.com/support/topic/8-2-1-database-upgrade-error/
Now how does this relate to this issue you might ask…
The fallback search that Connections performs, there is a minimum character requirement. This is not imposed by Connections. It is imposed by the db and how the web hosts configured it. Most hosts set this minimum to 3 characters, but a few set this as 4. Basically this means any searches equal to or less will not be search for by the db.
You can test if this is the case by adding just one more character to the name. My guess it’ll be returned as a search result. If that is the case there’s it is not a bug and there is nothing I can do about this minimum character requirement, sorry.
As a possible work around, you might be able to add a space character before or after the name. I’m not certain how the db counts a space character.
Let me know what you find out.
08/28/2015 at 1:19 pm #344784Charles McPadden
ParticipantHey,
Thanks for the response. I appreciate the feedback, but I think something else is going on. Here’s why. Within my directory, I have a user named Allen. If I search on “al” (two letters) the search locates Allen’s listing within the directory. I have another user named Abby (the same number of letters as Will). If I search on “Abby” (4 letters) she is located within the directory. Further, if I search on “ab” Abby is located. However, Will is not located when I search on “Will”. I even deleted Will’s entry from the database and added him back. Still no luck.
If there was consistency, I could understand the issue. However, what doesn’t work for locating Will, does work for locating Abby.
08/29/2015 at 10:58 am #344842Steven Zahm
Keymaster@ Charles
Ahhh… the added details helped. Obviously I didn’t think of this before, but the reason is “will” is one of the search stop words. I use the same stop word list as WordPress uses… stop words are terms that are stripped from search queries because they are too common of a word. hey are removed from search queries because these words would result is a very high number of unrelated search results.
This can be addressed with a filtering that stop word list to remove “will”. Here’s how:
Install the Code Snippets plugin.
Add a new snippet with the following code.
add_filter( 'wp_search_stopwords', 'cn_filter_stopwords' ); function cn_filter_stopwords( $stopwords ) { if ( $key = array_search( 'will', $stopwords ) ) { unset( $stopwords[ $key ] ); } return $stopwords; }
Save and activate the new snippet.
Now “will” should be removed from the stop words so he should now show up as a search result.
Hope that helps, let me know.
08/31/2015 at 10:35 am #344996Charles McPadden
ParticipantI think we’re on the right track here. Unfortunately, that code didn’t resolve the issue. Are you sure the code is correct?
08/31/2015 at 10:39 am #344997Charles McPadden
ParticipantDisregard my last comment. Your code worked perfectly. I had enabled the plugin , but not the actual code snippet. Once I enabled the snippet, everything worked perfectly.
Thank you so much!
Charles
08/31/2015 at 3:07 pm #345043Steven Zahm
Keymaster@ Charles
Good to hear!
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.