[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/search/src/fetcher/ -> lmbSearchFetcher.class.php (source)

   1  <?php
   2  /*
   3   * Limb PHP Framework
   4   *
   5   * @link http://limb-project.com 
   6   * @copyright  Copyright &copy; 2004-2007 BIT(http://bit-creative.com)
   7   * @license    LGPL http://www.gnu.org/copyleft/lesser.html 
   8   */
   9  lmb_require('limb/search/src/db/query/lmbMySQL4FullTextSearchQuery.class.php');
  10  lmb_require('limb/web_app/src/fetcher/lmbFetcher.class.php');
  11  
  12  /**

  13   * class lmbSearchFetcher.

  14   *

  15   * @package search

  16   * @version $Id: lmbSearchFetcher.class.php 5945 2007-06-06 08:31:43Z pachanga $

  17   */
  18  class lmbSearchFetcher extends lmbFetcher
  19  {
  20    protected function _createDataSet()
  21    {
  22      $query = new lmbMySQL4FullTextSearchQuery('full_text_uri_content_index',
  23                                                $this->_getQueryWords(),
  24                                                true,
  25                                                lmbToolkit :: instance()->getDefaultDbConnection());
  26  
  27      return $query->getRecordSet();
  28    }
  29  
  30    protected function _collectDecorators()
  31    {
  32      if($words = $this->_getQueryWords())
  33        $this->addDecorator('limb/search/src/dataset/lmbSearchResultProcessor',
  34                            array('words' => $words,
  35                                  'matched_word_folding_radius' => 40,
  36                                  'gaps_pattern' => '...',
  37                                  'match_left_mark' => '<b>',
  38                                  'match_right_mark' => '</b>',
  39                                  'matching_lines_limit' => 4));
  40    }
  41  
  42    protected function _getQueryWords()
  43    {
  44      $request = lmbToolkit :: instance()->getRequest();
  45      $query = $request->get('query_string');
  46      return explode(' ', htmlspecialchars($query));
  47    }
  48  }
  49  
  50  ?>


Generated: Sat Aug 30 04:38:32 2008 Cross-referenced by PHPXref 0.7