title: Magento Search 'relevance' Value is Always 0
body: <p>I noticed that I seemingly wasn't able to sort on relevance in a default search. Whether I tried ASC or DESC, the results were always the same and rather poorly relevant at that.</p>
  
  <p>Upon further investigating, I found the addSearchFilter() method in <strong>Mage_CatalogSearch_Model_Resource_Fulltext_Collection</strong> :</p>
  
  <pre><code>/**
   * Add search query filter
   *
   * @param string $query
   * @return Mage_CatalogSearch_Model_Resource_Fulltext_Collection
   */
  public function addSearchFilter($query)
  {
      Mage::getSingleton('catalogsearch/fulltext')-&gt;prepareResult();
  
      $this-&gt;getSelect()-&gt;joinInner(
          array('search_result' =&gt; $this-&gt;getTable('catalogsearch/result')),
          $this-&gt;getConnection()-&gt;quoteInto(
              'search_result.product_id=e.entity_id AND search_result.query_id=?',
              $this-&gt;_getQuery()-&gt;getId()
          ),
          array('relevance' =&gt; 'relevance')
      );
  
      Zend_Debug::dump($this-&gt;getData());exit;
  
      return $this;
  }
  </code></pre>
  
  <p>The result of my data dump shows the results just fine, but the 'relevance' column is always 0.00000. I have not made any changes to the catalog search and this is Magento 1.6.0.</p>
  
  <p>I dumped the actual SQL as well:</p>
  
  <pre><code>SELECT `e`.*, `search_result`.`relevance` FROM `catalog_product_entity` AS `e` INNER JOIN `catalogsearch_result` AS `search_result` ON search_result.product_id=e.entity_id AND search_result.query_id='33'
  </code></pre>
  
  <p>If anyone else has more experience with calculating relevance I would greatly appreciate direction.</p>