1

Is there a way for e.g. searching by last name, of producing exact search results.

So if I searched for Last Name, Head. I currently get email addresses with head in etc not just people with the surname head.

Thanks.

CIVICRM 4.5.8 Drupal

4

It can be done navigating to Administer -> Customize Data and Screens -> Search Preferences, the first option is Automatic Wildcards, disable it.

If enabled, wildcards are automatically added to the beginning AND end of the search term when users search for contacts by Name. EXAMPLE: Searching for 'ada' will return any contact whose name includes those letters - e.g. 'Adams, Janet', 'Nadal, Jorge', etc. If disabled, a wildcard is added to the end of the search term only. EXAMPLE: Searching for 'ada' will return any contact whose last name begins with those letters - e.g. 'Adams, Janet' but NOT 'Nadal, Jorge'. Disabling this feature will speed up search significantly for larger databases, but users must manually enter wildcards ('%' or '_') to the beginning of the search term if they want to find all records which contain those letters. EXAMPLE: '%ada' will return 'Nadal, Jorge'.

Please note: forgot to mention that changing this option will change the behaviour for all contact search forms, not sure if that's what you want to achieve, if it's not, @petednz comment is a very good and better answer

  • 1
    You could also use Search Builder (under Search in Admin menu) and set Contact Type = Individual AND Last Name = Head. – petednz - fuzion Jan 19 '16 at 18:51
  • Very good addition @petednz, made me realize I assumed the question was to change search's default behavior. Answer edited. – Andrei Jan 19 '16 at 19:37
  • cool - i will add my as an alternate answer then – petednz - fuzion Jan 19 '16 at 23:34
2

For undertaking a single search, which may not be what you are after, you can use Search Builder (under Search in Admin menu) and set Contact Type = Individual AND Last Name = Head

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.