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.2.10. search
- This topic has 3 replies, 2 voices, and was last updated 11 years, 1 month ago by
Steven Zahm.
-
AuthorPosts
-
06/28/2015 at 5:33 pm #338830
RYC
ParticipantIs there a way for users to search for “is” rather than “includes?”
We have a club where each member owns a unit. We’re using the “Title” field for the Unit #, which works fine, and each number is prefaced with the hashtag (e.g. #1) which we thought would avoid having street numbers, phone numbers, etc. show up in a search.
But the problem is, if #1 for example is entered into the search box it produces all entries where the Title field contains #1, #11, #12, etc.
Any suggestions?
Thanks.
06/30/2015 at 11:11 am #339092Steven Zahm
Keymaster@ Walt
Sorry, no, when searching with such short strings due to db limitations regarding search those searches will use a “LIKE” (includes) query.
That said… if you know a bit of PHP you could alter the query. I believe you would have to change this line of code. Something like this might work:
$like[] = $wpdb->prepare( implode( ' LIKE %s OR ' , $atts['fields']['entry'] ) . ' LIKE %s ', array_fill( 0, count( $atts['fields']['entry'] ), like_escape( $word ) ) );Let me know if that helps!
07/01/2015 at 4:23 pm #339301RYC
ParticipantI actually found a workaround for this too. For some reason if I use the format “Unit_X” (with an underscore — not Unit X or Unit-X) in the title field, then a search for Unit_30, for example, yields only Unit 30, not Units 3, 13, 23, etc. It requires a note on the directory page to the user to input the search exactly that way, but it works.
BTW, this software and template is exactly what I was looking for and thanks for taking the time to answer questions. Much appreciated!
07/02/2015 at 8:03 am #339332Steven Zahm
Keymaster@ Walt
Great to hear you found a solution that works for you. Using the longer search strings will cause a more exact search methods to be used.
If you have a moment, I would truly appreciate a review as they really do make a difference. Many thanks in advance!
https://wordpress.org/support/view/plugin-reviews/connections
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.
