Answers.Body: <p>I found a way to get this work. I don't know if it's quite a hack, but it works at least. </p>
  
  <p>Change this line in the "CRM/Contact/BAO/Query.php": public function sortName(&amp;$values):</p>
  
  <pre><code>if ($fieldName == 'sort_name') {
  $wc = self::caseImportant($op) ? "LOWER(contact_a.sort_name)" : "contact_a.sort_name";
  } else {
  $wc = self::caseImportant($op) ? "LOWER(contact_a.display_name)" : "contact_a.display_name";
  }
  </code></pre>
  
  <p>to: </p>
  
  <pre><code>  $wc = self::caseImportant($op) ? "LOWER(contact_a.sort_name)" : "contact_a.sort_name";
    $fieldsub[] = " ( $wc $op $value )";
  
    $wc = self::caseImportant($op) ? "LOWER(contact_a.display_name)" : "contact_a.display_name";
    $fieldsub[] = " ( $wc $op $value )";
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-23T19:46:40.823Z
Answers.Text: If this is indeed a bug then please open a ticket in JIRA and try to provide a patch - https://issues.civicrm.org/jira
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-23T09:26:48.743Z
Answers.LastActivityDate: 2015-09-23T09:26:48.743Z
Answers.UserDisplayName: woistjadefox
Answers.Body: <p>It should show up both contacts, I suspect there might be something in the setup of your sort name. Could you attach some screen prints so I can see what happens?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-17T14:54:47.883Z
Answers.Text: When I search for "John Wayne" I get this result:
  http://goga.ch/tmp/iogt/screen1.png
  
  When I serach for "Wayne" this:
  http://goga.ch/tmp/iogt/screen2.png
  
  But if I check for "Wayne, John" I only get the Individual:
  http://goga.ch/tmp/iogt/screen3.png
  
  The settings for the sort name in the display preferences look like this:
  http://goga.ch/tmp/iogt/screen4.png
Answers.UserDisplayName: woistjadefox
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-17T15:24:03.450Z
Answers.Text: @woistjadefox, what is your Automatic Wildcard set to?  (Administer > Customize Data and Screens > Search Preferences)
Answers.UserDisplayName: Allen Hutchison
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-17T15:41:17.383Z
Answers.Text: @AllenHutchison, it's set to "Yes". Tried it with "No" but it didn't have any effect.
Answers.UserDisplayName: woistjadefox
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-17T09:23:01.553Z
Answers.LastActivityDate: 2015-09-17T09:23:01.553Z
Answers.UserDisplayName: ErikH - CiviCooP
Answers.Body: <p>I have just tried your search on the demo site after adding your examples, and I get both contacts if I search for John Wayne in both Advanced Search and Search Contacts.<a href="https://i.sstatic.net/lvSN8.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/lvSN8.png" alt="enter image description here"></a></p>
  
  <p>I think this is your desired behaviour?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-17T15:32:59.810Z
Answers.Text: Yes exactly. But what could be the reason that It doesn't show both on my installation? I didn't change anything in the sort name settings.
Answers.UserDisplayName: woistjadefox
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-17T15:53:09.663Z
Answers.Text: just tried the same on the demo of the CiviCRM v4.6 on Drupal version: http://d46.demo.civicrm.org
  
  I can reproduce the behavior of my installation. On which demo site did you try it?
Answers.UserDisplayName: woistjadefox
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-17T21:37:20.883Z
Answers.Text: Concur with Mr Fox. searching "john wayne" on demo via QuickSearch, Find, or Adv Search all return a single result of the household, whereas searching for just "wayne" returns both results
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-19T13:08:36.787Z
Answers.Text: I tried on the 4.5 demo, so it smells like a 4.6 bug?
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-21T14:52:23.820Z
Answers.Text: Argh.. any idea in which modul/file I could fix this my-self?
Answers.UserDisplayName: woistjadefox
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-17T15:15:51.047Z
Answers.LastActivityDate: 2015-09-17T15:15:51.047Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>I have a individual contact called: "John Wayne". 
  He is connected to a household called "John and Margret Wayne". </p>
  
  <p>When I search now for "John Wayne" in the simple search an in the advanced search, it only returns the household. Is this a normal behavior? Our NGO workers get super confused about this, is there a way to get the individual and household contact in the result table? </p>
  
Tags: <search><search-results>
Title: Search behavior Individual/Household
ThreadText: # Search behavior Individual/Household
  
  (Asked by: username_0 on 2015-09-17)
  
  I have a individual contact called: "John Wayne".
  He is connected to a household called "John and Margret Wayne".
  
  When I search now for "John Wayne" in the simple search an in the advanced search, it only returns the household. Is this a normal behavior? Our NGO workers get super confused about this, is there a way to get the individual and household contact in the result table?
  
  **Tags:** search, search-results
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_0 on 2015-09-23. Score: 0 | Accepted answer
  
  I found a way to get this work. I don't know if it's quite a hack, but it works at least.
  
  Change this line in the "CRM/Contact/BAO/Query.php": public function sortName(&$values):
  
  ```
  if ($fieldName == 'sort_name') {
  $wc = self::caseImportant($op) ? "LOWER(contact_a.sort_name)" : "contact_a.sort_name";
  } else {
  $wc = self::caseImportant($op) ? "LOWER(contact_a.display_name)" : "contact_a.display_name";
  }
  
  ```
  
  to:
  
  ```
    $wc = self::caseImportant($op) ? "LOWER(contact_a.sort_name)" : "contact_a.sort_name";
    $fieldsub[] = " ( $wc $op $value )";
  
    $wc = self::caseImportant($op) ? "LOWER(contact_a.display_name)" : "contact_a.display_name";
    $fieldsub[] = " ( $wc $op $value )";
  
  ```
  
  > **Comments:**
  > **username_1**: If this is indeed a bug then please open a ticket in JIRA and try to provide a patch - https://issues.civicrm.org/jira  
  
  ---
  
  ### Answer by username_2 on 2015-09-17. Score: 2
  
  It should show up both contacts, I suspect there might be something in the setup of your sort name. Could you attach some screen prints so I can see what happens?
  
  > **Comments:**
  > **username_0**: When I search for "John Wayne" I get this result: http://goga.ch/tmp/iogt/screen1.png  When I serach for "Wayne" this: http://goga.ch/tmp/iogt/screen2.png  But if I check for "Wayne, John" I only get the Individual: http://goga.ch/tmp/iogt/screen3.png  The settings for the sort name in the display preferences look like this: http://goga.ch/tmp/iogt/screen4.png  
  > **username_3**: @username_0, what is your Automatic Wildcard set to?  (Administer > Customize Data and Screens > Search Preferences)  
  > **username_0**: @username_3, it's set to "Yes". Tried it with "No" but it didn't have any effect.  
  
  ---
  
  ### Answer by username_2 on 2015-09-17. Score: 1
  
  I have just tried your search on the demo site after adding your examples, and I get both contacts if I search for John Wayne in both Advanced Search and Search Contacts.[![enter image description here](https://i.sstatic.net/lvSN8.png)](https://i.sstatic.net/lvSN8.png)
  
  I think this is your desired behaviour?
  
  > **Comments:**
  > **username_0**: Yes exactly. But what could be the reason that It doesn't show both on my installation? I didn't change anything in the sort name settings.  
  > **username_0**: just tried the same on the demo of the CiviCRM v4.6 on Drupal version: http://d46.demo.civicrm.org  I can reproduce the behavior of my installation. On which demo site did you try it?  
  > **username_1**: Concur with Mr Fox. searching "john wayne" on demo via QuickSearch, Find, or Adv Search all return a single result of the household, whereas searching for just "wayne" returns both results  
  > **username_2**: I tried on the 4.5 demo, so it smells like a 4.6 bug?  
  > **username_0**: Argh.. any idea in which modul/file I could fix this my-self?  
  
  ---
  
  