Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-7827

Provide an AND / OR option to advanced search

    Details

    • Type: New Feature
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.3.5
    • Fix Version/s: 3.4.1
    • Component/s: CiviCRM Search
    • Labels:
      None

      Description

      Currently with Advanced search all the clauses are AND'ed together. We should give folks the options to "OR" the clauses. Most of the times each clause is a form element.

      Also allow this "Search Operator" to be sent in via the url, so admins can create navigation menu items. Default operator is AND. Add "&operator=OR" to change the default operator to OR via URL.

      This will apply across all accordion tabs, including custom fields. Thus if a user has selected:

      Groups G1, G2
      State: CA
      Country: US
      Custom Field 1: '123'

      we will return all contacts that satisfy the clause:

      AND operator: ( In Groups G1 OR G2 ) AND State = 'CA' AND Country = 'US' AND Custom Field 1 = '123'

      OR operator: ( In Groups G1 OR G2 ) OR State = 'CA' OR Country = 'US' OR Custom Field 1 = '123'

      Note that the groups, tags and other multi-select and most checkbox elements like State, Activity Type, Activity Status etc. are single elements, and their values are always OR'ed

      A few other changes:

      1. Number ranges (e.g. contribution amounts) and Date ranges (e.g. contribution dates) are always AND'ed irrespective of search operator

      2. we suppress the is_test clause for Seach operator for test contributions / participants OR (ideally we'd like to set it so that it is included as an AND)

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              lobo Donald A. Lobo
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1 day, 2 hours
                1d 2h
                Remaining:
                Remaining Estimate - 1 day, 2 hours
                1d 2h
                Logged:
                Time Spent - Not Specified
                Not Specified