CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • E-mail Address Search in CiviCRM 2.0.6
Pages: [1]

Author Topic: E-mail Address Search in CiviCRM 2.0.6  (Read 1630 times)

LanceD

  • Guest
E-mail Address Search in CiviCRM 2.0.6
August 31, 2008, 01:06:56 pm
Apparently the search function in CiviCRM 2.0.6 isn't working right when searching for e-mails.  It took a while but my client recognized that when she searched for certain contacts (whose e-mail address we know is in the system), CiviCRM would report back that there was no contact in the system with that address.

Upon further investigation, it seems this was occurring for "secondary" e-mail addresses because primary addresses work fine.  I have verified that this is the case with a few contacts and have verified that the database has the e-mail address in it.  The only difference I can see in the data is that one e-mail is primary and one is not.

What can we do (or edit) to fix this?

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: E-mail Address Search in CiviCRM 2.0.6
August 31, 2008, 03:15:16 pm

the default behavior is to search the primary email address only. To search non-primary / email addresses in other locations, you will need to use search builder or build a custom search. If you want to hack the code to enable this, you should look at: CRM/Contact/BAO/Query.php, and hack the places where we use the table civicrm_email (specifically the LEFT JOIN condition)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

LanceD

  • Guest
Re: E-mail Address Search in CiviCRM 2.0.6
September 01, 2008, 01:08:40 pm
Thanks, Lobo.  I think that will help my client.

But if you don't mind my asking... why is that?  Is it just a performance "tweak"?  It seems like most people wouldn't care whether the e-mail address was primary, secondary, home, work, etc.... they'd just want to know who the contact was (or if they had the e-mail address on file at all).

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: E-mail Address Search in CiviCRM 2.0.6
September 01, 2008, 02:13:02 pm
Quote from: LanceD on September 01, 2008, 01:08:40 pm
But if you don't mind my asking... why is that?  Is it just a performance "tweak"?  It seems like most people wouldn't care whether the e-mail address was primary, secondary, home, work, etc.... they'd just want to know who the contact was (or if they had the e-mail address on file at all).

I agree with you on that. I think to some extent, it came off as a by-product of the 1.x location / primary schema and then just carried onto 2.1 since no one raised it.

With regard to performance, I think without real numbers and benchmarking might be hard to pass it off as absolutely needed for performance. We should definitely reconsider this decision for the 3.x release. Wanna file an issue?

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

LanceD

  • Guest
Re: E-mail Address Search in CiviCRM 2.0.6
September 02, 2008, 11:03:58 am
Lobo,

I'll definitely file an issue (later today).  And while I can't speak to performance either, it seems like the possibility of a significant performance hit only applies if you're using LIKE statements to find the e-mail address.  If you're doing a exact match, it seems like the performance hit would be negligible. 

- Lance

LanceD

  • Guest
Re: E-mail Address Search in CiviCRM 2.0.6
September 03, 2008, 06:27:36 pm
The issue has been filed as http://issues.civicrm.org/jira/browse/CRM-3493.  Thanks!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • E-mail Address Search in CiviCRM 2.0.6

This forum was archived on 2017-11-26.