Answers.Body: <p>There's an extension for this that provides a custom search called <a href="https://github.com/JMAConsulting/biz.jmaconsulting.search.anyteloremail" rel="nofollow">Any Telephone or Email</a>.</p>
  
  <p><a href="http://ourpowerbase.net" rel="nofollow">Powerbase</a>, the CiviCRM distribution from <a href="http://progressivetech.org" rel="nofollow">Progressive Technology Project</a>, cleverly has a custom Drupal module to display a search block that exposes this custom search at all times.</p>
  
  <p>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 <a href="https://github.com/PalanteJon/anytelemail_search_block" rel="nofollow">uploaded it to Github here</a>.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-13T13:47:57.727Z
Answers.LastActivityDate: 2016-04-13T13:47:57.727Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.Body: <p>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.</p>
  
  <p><a href="https://i.sstatic.net/0UGeC.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/0UGeC.png" alt="Search builder, email types"></a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-12T20:46:09.177Z
Answers.Text: Yea, I did think about search builder but to have an average user go through and select all the different types is bit much.
Answers.UserDisplayName: Paul-Tahoe
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-12T16:35:54.390Z
Answers.LastActivityDate: 2016-04-12T16:35:54.390Z
Answers.UserDisplayName: Allen Hutchison
Answers.Body: <p>Under CiviCRM search preferences, there’s an option “Search Primary Details Only” which is defaulted to “Yes”.  /civicrm/admin/setting/search?reset=1</p>
  
  <p>Setting this option to “No” will allow you to search on any location type via advanced search. </p>
  
  <p>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.</p>
  
  <p>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.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-08T19:06:59.773Z
Answers.Text: 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.
Answers.UserDisplayName: Paul-Tahoe
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-08T11:31:33.473Z
Answers.LastActivityDate: 2018-10-08T11:31:33.473Z
Answers.UserDisplayName: Anil
Body: <p>Right now, as far as I can tell and from what I've seen in <a href="https://forum.civicrm.org/index.php?topic=7234.0" rel="nofollow">old issues</a> and current <a href="https://issues.civicrm.org/jira/browse/CRM-4287" rel="nofollow">jira issue</a>, searches only search for primary email address.  Worried about performance issues.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-04-13T00:18:43.633Z
Comments.Text: will you hate me if i suggest a drupal views or search api type search block?
Comments.UserDisplayName: petednz - fuzion
Tags: <email><search>
Title: Is there anyway to search on a non-primary email address?
ThreadText: # Is there anyway to search on a non-primary email address?
  
  (Asked by: username_0 on 2016-04-12)
  
  Right now, as far as I can tell and from what I've seen in [old issues](https://forum.civicrm.org/index.php?topic=7234.0) and current [jira issue](https://issues.civicrm.org/jira/browse/CRM-4287), 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.
  
  **Tags:** email, search
  
  > **Comments:**
  > **username_1**: will you hate me if i suggest a drupal views or search api type search block?  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_4 on 2018-10-08. Score: 4 | Accepted answer
  
  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.
  
  > **Comments:**
  > **username_0**: 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.  
  
  ---
  
  ### Answer by username_2 on 2016-04-13. Score: 4
  
  There's an extension for this that provides a custom search called [Any Telephone or Email](https://github.com/JMAConsulting/biz.jmaconsulting.search.anyteloremail).
  
  [Powerbase](http://ourpowerbase.net), the CiviCRM distribution from [Progressive Technology Project](http://progressivetech.org), 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](https://github.com/PalanteJon/anytelemail_search_block).
  
  
  ---
  
  ### Answer by username_3 on 2016-04-12. Score: 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](https://i.sstatic.net/0UGeC.png)](https://i.sstatic.net/0UGeC.png)
  
  > **Comments:**
  > **username_0**: Yea, I did think about search builder but to have an average user go through and select all the different types is bit much.  
  
  ---
  
  