6

Right now, as far as I can tell and from what I've seen in old issues and current jira issue, searches only search for primary email address. Worried about performance issues.

So it appears there is no way to search any email address that isn't marked as the primary other than writing sql or a custom search.

Maybe I'm missing something and there is a way. If not, to me this is major weakness, but maybe I'm alone in my thinking. The issue has been out there for 6 years and was last put off until after 4.7 so maybe it isn't a big deal for most people.

  • will you hate me if i suggest a drupal views or search api type search block? – petednz - fuzion Apr 13 '16 at 0:18
3

Under CiviCRM search preferences, there’s an option “Search Primary Details Only” which is defaulted to “Yes”. /civicrm/admin/setting/search?reset=1

Setting this option to “No” will allow you to search on any location type via advanced search.

Tip - Searching for a non-primary email address via the quick search will not display results as you type, however pressing enter once you've typed the email address in the quick search box will produce expected results for non-primary email addresses.

Info on this setting - If enabled, only primary details (eg contact's primary email, phone, etc) will be included in Basic and Advanced Search results. Disabling this feature will allow users to match contacts using any email, phone etc detail.

  • Great. This feature didn't exist when this question was written. Well, it's not in the version we are currently using but soon we'll be upgrading to one that does have it. – Paul-Tahoe Oct 8 '18 at 19:06
4

In Search Builder (Top menu > Search > Search Builder), you can specify which type of email address you would like to search for (on the demo: Home, Work, Main, etc.). By linking the searches with "Also include contacts where", you can specify each type to include (see image). It doesn't cover the specific search "emails that are not marked primary," but it will search emails that are not primary along with the primary ones as well.

Search builder, email types

  • Yea, I did think about search builder but to have an average user go through and select all the different types is bit much. – Paul-Tahoe Apr 12 '16 at 20:46
4

There's an extension for this that provides a custom search called Any Telephone or Email.

Powerbase, the CiviCRM distribution from Progressive Technology Project, cleverly has a custom Drupal module to display a search block that exposes this custom search at all times.

However, the Powerbase Drupal module also does many other things specific to their install - so a little while back, I stripped out all the code except that necessary to expose this custom search in a block. I've just uploaded it to Github here.

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.