connect apache solr to a custom search function I am having some trouble with creating a search module (dictionary) that uses apache solr.
The current module is connected to a solr instance from a different source that has a indexation from a postgresql database with it's own schema.

Now I'm in the process migrating all the content to nodes in Drupal and so far so good.
The thing now is that I need to change the search request from the current solr to Drupal apachesolr with its standard schema. Problem is that I am relative new to how solr works, but I do understand the basic structure.

Anyone that might be able to give me a hand or point me to some kind of documentation to how to do this? 

I tried to change the query search quartiles from what i could find in the schema . The only thing keep getting when i do a search is "Your search yielded no results"

Here is the cod in the callbacks.inc file unmodified 

&lt;?php

function ne_norstedts_page($types) {
  $ret = '';

  $form = drupal_get_form('ne_norstedts_search_form', $types);

  // Render search form.
  $ret .= '&lt;div id="norstedts-search-form" class="fourcol"&gt;';
  $ret .= render($form);
  $ret .= '&lt;/div&gt;';

  // Get search results and output them
  isset($_GET) ? extract($_GET) : '';
  if (isset($q) &amp;&amp; isset($from) &amp;&amp; isset($to) &amp;&amp; isset($type)) {
    $query = array(
      'q'  =&gt; $nq,
      'fq' =&gt; 'type:norstedts AND subtype:' . $from . '-' . $to . '-' . $type,
      'start' =&gt; isset($page) ? ($page) * 10 : 0,
    );

    $result = ne_api_get_api_fetch('/search', $query);

    $title = '';
    foreach ($types as $t =&gt; $name) {
      if ($t == $type) {
        $title = $name;
        break;
      }
    }

    $ret .= theme('ne_norstedts_results', array('result' =&gt; $result['result'], 'title' =&gt; $title));
  }

  return $ret;
}

/**
 * Gets text for a single word for ajax
 */
function ne_norstedts_ajax_load_word() {
  $url = isset($_GET['url']) ? $_GET['url'] : '';
  if ($url) {
    $result = ne_api_get_api_fetch($url);
    if (isset($result['text'])) {
      echo drupal_json_encode($result['text']);
    }
  }
  exit;
}


and here is my modified version of it 

&lt;?php

function ne_dictionary_page($types) {
  $ret = '';

  $form = drupal_get_form('ne_dictionary_search_form', $types);

  // Render search form.
  $ret .= '&lt;div id="dictionary-search-form" class="fivecol"&gt;';
  $ret .= render($form);
  $ret .= '&lt;/div&gt;';

  // Get search results and output them
  isset($_GET) ? extract($_GET) : '';
  if (isset($q) &amp;&amp; isset($from) &amp;&amp; isset($to) &amp;&amp; isset($type)) {
    $query = array(
      'q'  =&gt; $nq,
      'fq' =&gt; 'site:' . $from . '-' . $to,
      'start' =&gt; isset($page) ? ($page) * 10 : 0,
    );

    $result = apachesolr_search_search_page('/search', $query);

    $title = '';
    foreach ($types as $t =&gt; $name) {
      if ($t == $type) {
        $title = $name;
        break;
      }
    }

    $ret .= theme('ne_dictionary_results', array('result' =&gt; $result['result'], 'title' =&gt; $title));
  }

  return $ret;
}

/**
 * Gets text for a single word for ajax
 */
function ne_dictionary_ajax_load_word() {
  $url = isset($_GET['url']) ? $_GET['url'] : '';
  if ($url) {
    $result = apachesolr_search_search_page($url);
    if (isset($result['text'])) {
      echo drupal_json_encode($result['text']);
    }
  }
  exit;
}
You dont need a module for this. Activate your solr module, index your content and the core drupal search will be replaced by the solr search. 
There is nothing else you need to do. From then on, every search you make using the domain.com/search/site url will be automatically directed to solr.

It is just a matter of setting the right options in the solr module.