Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/03/2014 08:51:44 PM (10 years ago)
Author:
djpaul
Message:

Core: adjust the SQL generated by BP_User_Query's search_wildcard parameter for better Suggestions API search results.

Introduced in r8675, the search_wildcard parameter controls where BuddyPress places MySQL wildcard characters around the search term (when it's set).

This change adjusts how the wildcard SQL is constructed; in addition to the wildcard, we now also check for matches that have a single space character at the opposite end of the string (from where the wildcard is). This allows searching data that looks like (for example) a surname in a combined first name/surname field.
e.g. if a displayname is "Paul Gibbs", you can search for "Gi", and with search_wildcard=right, the SQL generated will be LIKE 'Gi%' OR LIKE '% Gi%'.

See #3278

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-classes.php

    r8669 r8753  
    43884388            'per_page'        => $this->args['limit'],
    43894389            'search_terms'    => $this->args['term'],
     4390            'search_wildcard' => 'right',
    43904391        );
    43914392
Note: See TracChangeset for help on using the changeset viewer.