Where is source code of advanced search form? I can't find where in Drupal 7 search module is the source code of advanced search form that appears on search result site.

Below is code of search_form. You can see there is basic key in renderable array. In output of dpm is even advanced key, but i can't find from where it comes.

It should be probably somewhere in search module, but it is not big module and i checked it last 4 hours and can't find it.

function search_form($form, &amp;$form_state, $action = '', $keys = '', $module = NULL, $prompt = NULL) {
  $module_info = FALSE;
  if (!$module) {
    $module_info = search_get_default_module_info();
  }
  else {
    $info = search_get_info();
    $module_info = isset($info[$module]) ? $info[$module] : FALSE;
  }

  // Sanity check.
  if (!$module_info) {
    form_set_error(NULL, t('Search is currently disabled.'), 'error');
    return $form;
  }

  if (!$action) {
    $action = 'search/' . $module_info['path'];
  }
  if (!isset($prompt)) {
    $prompt = t('Enter your keywords');
  }

  $form['#action'] = url($action);
  // Record the $action for later use in redirecting.
  $form_state['action'] = $action;
  $form['#attributes']['class'][] = 'search-form';
  $form['module'] = array('#type' =&gt; 'value', '#value' =&gt; $module);
  $form['basic'] = array('#type' =&gt; 'container', '#attributes' =&gt; array('class' =&gt; array('container-inline')));
  $form['basic']['keys'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; $prompt,
    '#default_value' =&gt; $keys,
    '#size' =&gt; $prompt ? 40 : 20,
    '#maxlength' =&gt; 255,
  );
  // processed_keys is used to coordinate keyword passing between other forms
  // that hook into the basic search form.
  $form['basic']['processed_keys'] = array('#type' =&gt; 'value', '#value' =&gt; '');
  $form['basic']['submit'] = array('#type' =&gt; 'submit', '#value' =&gt; t('Search'));

  return $form;
}
The advanced form is altered in node.module and not in search.module. you can find the below function for advance search in node.module, Please have a look in the below hook:
 function node_form_search_form_alter(&amp;$form, $form_state)