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.
- This topic has 2 replies, 2 voices, and was last updated 11 years, 6 months ago by
Michael Rest.
-
AuthorPosts
-
02/10/2015 at 1:12 pm #318926
Michael Rest
ParticipantHello Steven,
I have found a problem searching for a few things. I have about 2300 people in my directory, and for the majority the search returns the expected results.
One example of the problem manifests when I search for “Will”. No results are returned. That’s not really what I expected, so I went to the management console and changed the name to William as a test. Searching “Will” still did not return any results. I next tried “Wil” and that returned about 20 users, the one in question being included. So I changed his name back to Will and did the search again with “Wil”, it returned him in the list with Will as a first name.
I thought there might be some rule in place that is failing when there are two “L” characters beside each other, so I searched “ll”; no results.
Over the next few minutes, I did some random searching to see if I could lock down a pattern, but the only things I found were: Failed on “Will”; Worked on “Bill” Worked on “aa”. (Aaron); failed on “eed” for Steed; worked on “Ste” for Steed.
I do not know if there are any other names that would fail, but is there a way to correct this so people can search for “Will” or any other configuration of names that are actual names but are not being returned?
Thanks for a great product and support. I’ve attached some screenshots to help.
-Michael
Attachments:
You must be logged in to view attached files.02/10/2015 at 1:44 pm #318930Steven Zahm
Keymaster@ Michael
Ahhh… yes. I immediately tested this and was able to reproduce it. My first thought; “Well, this is hokey!”
I did quickly find the issue though. As part of the search logic, I run the keywords thru the same list of stopwords that WP uses and then strips those stopwords from the search.
I give you one guess what one of the stopwords are. Yes, one of them is “will”, so when you search for “Will” it’ll get stripped and new results found. That explains why searching for “Wil” works.
I think maybe I should remove “will” from the stopwords … none of the others do not seem like they would interfere with searching for names.
Luckily this is fixable right now… here’s how:
Install the Code Snippets plugin.
Add a new snippet with the following code:add_filter( ‘wp_search_stopwords’, ‘cn_remove_will_from_stopwords’ );
function cn_remove_will_from_stopwords( $stopwords ) {
if ( FALSE !== $key = array_search( 'will', $stopwords ) ) { unset( $stopwords[ $key ] ); } return $stopwords;}
Save and activate the new snippet.
And like magic, search “will” should return the expected results.
Apologies for the trouble!
If you have a moment, I would truly appreciate a review as they really do make a difference. Thanks in advance!
https://wordpress.org/support/view/plugin-reviews/connections02/10/2015 at 4:35 pm #318932Michael Rest
ParticipantThank you for the quick response and solution!
I added that function and filter to my custom functions.php and it worked like a charm.
-Michael
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.
