Display results if at least one search criterion is matched

BP Profile Search Display results if at least one search criterion is matched

  • Author
    Post
  • #12559 Reply
    Mehmet
    Guest

    Hi,

    I’m using BP Profile Search with several custom fields.
    Currently, if a user runs a search and not all criteria are matched, the search returns no results.

    I would like to display members who match at least one of the selected criteria, or ideally give users the option to choose between strict and flexible search.

    Is there a way to configure the search to work in OR mode instead of AND?
    Or do you have a recommended workaround to make the search less restrictive?

    Thanks in advance!

    Best regard

    #12560 Reply
    andrea
    Plugin Author

    Hi Mehmet,

    You can add this line to your bp-custom.php file, or to your code snippets plugin:

    add_filter ('bps_match_all', '__return_false');

    This will return results that match at least one of your search criteria.

Reply to: Display results if at least one search criterion is matched
My Information