Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Andrea Tarantini

    (@dontdream)

    Hi schulz,

    You are right, the ‘Text Search Mode’ should apply separately to each field, I plan to do that in a future release.

    The meaning of the three modes is:

    contains: a search for John finds John, Johnson, Long John Silver, and so on;
    is: a search for John finds John only;
    is like: same as is, but with the optional wildcard characters:

    * Percent sign (%), that matches any text, or no text at all;
    * Underscore (_), that matches any single character.

    Thread Starter schulz

    (@schulz)

    Thank you for clearing that up for me.

    Maybe in your next release you can use these wildcard characters * and ? to include or replace % and _ respectively (if you already have not planned that already). When doing a wildcard search * or ? are the characters I think of first.

    I am thinking you are using % and _ because you are passing the search to the database directly. Allowing SQL query language in the search fields (if without a filter) could be dangerous, no?

    Plugin Author Andrea Tarantini

    (@dontdream)

    Hi schulz,

    I agree that * and ? are probably better known than % and _, but changing them after many years of usage could be a bad service to the existing users.

    And the SQL query is already filtered, of course 🙂

    Thread Starter schulz

    (@schulz)

    Thank you for your reply.

    Instead of changing, then maybe adding the extra wildcards (* also = % and ? also = _) this would allow any type of user to use the search fields without having to research how to use wildcards with your particular plugin.

    Plugin Author Andrea Tarantini

    (@dontdream)

    Not a bad idea, but it poses a problem: when the search text contains, say, both * and %, which is the wildcard and which a normal character?

    And by the way, users (admins) don’t have to research, they can simply use the Help tab in the upper right of the Edit Form screen.

    As for the normal, front-end users, if site owners offer a search form with Text Search Mode set to is like, I think it’s up to them to explain the feature to their users, as they see fit.

    Thread Starter schulz

    (@schulz)

    Not a bad idea, but it poses a problem: when the search text contains, say, both * and %, which is the wildcard and which a normal character?

    I can see ‘%’ being used as a normal character more than ‘*’, however it is unlikely either would be used as normal characters. Alphanumerical characters usually are the only thing searched for (words or patterns, not punctuation or symbols). Even if one or the other or all (* % ? _) were in the search, they should be treated as wildcard characters.

    And by the way, users (admins) don’t have to research, they can simply use the Help tab in the upper right of the Edit Form screen.

    Yes I was referring to front-end users (general public).

    As for the normal, front-end users, if site owners offer a search form with Text Search Mode set to is like, I think it’s up to them to explain the feature to their users, as they see fit.

    Anything designed for use by the general public that has to be explained in order to be used by the general public is considered poor design. And yes I’m guilty of that from time to time, though I try to minimize it.

    That said, we could debate this on and on. I was just suggesting making your search in your plugin a little more idiot proof by including more common wildcard characters.

    I will leave it at that and thank you for your views and explanations on this topic.

    Plugin Author Andrea Tarantini

    (@dontdream)

    Thank you for your suggestion. I see its merit, and probably I’ll implement it sooner or later.

    Thanks for the great plugin!

    I have the same kind of question. I have multiple selection options in a field (i.e. in field Fruit, there are options like apple, orange, grape, etc.). When I do a search and choose apple AND orange, if a user has either apple OR orange selected in their profile, they appear in the results. I have tried changing the Text Search Mode to contains, is, and is like, and they all yield the same list of results.

    What I would like is for the result to only show members who have both apple AND orange selected. Is that possible?

    Plugin Author Andrea Tarantini

    (@dontdream)

    Hi clutchm,

    You can add this code to your functions.php or bp-custom.php file:

    add_filter ('bps_field_checkbox_match_all', '__return_true');

    That worked perfectly. Thank you!

    Plugin Author Andrea Tarantini

    (@dontdream)

    You are welcome!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Text Search Mode’ is closed to new replies.