Klasa do obsługi wyszukiwania.  
 More...
| 
Public Member Functions | 
|  | __construct ($query, $indexer= '', array $options=array()) | 
|  | addType ($genre, $type) | 
|  | Adds a genre/type object to this search. 
 | 
|  | addAllItemTypes () | 
|  | isBoolean () | 
|  | Returns true if the query is boolean (uses special control characters) 
 | 
|  | expandQuery () | 
|  | Expands the query by replacing common word endings with wildcards. 
 | 
|  | expandWords ($text) | 
|  | run () | 
|  | Runs the query and returns the result Result is unfiltered, to filter the result and to have convenient access to search meta, use getResultCollection();. 
 | 
|  | getResultCollection ($checkAccess=true) | 
|  | Creates result collection. 
 | 
|  | getResult ($start=0, $limit=25, $checkAccess=true) | 
|  | Returns part of results as an array of array('obj', 'i', 'score') 
 | 
|  | getCount () | 
|  | getQueryString () | 
|  | Returns original query string. 
 | 
|  | getQuery () | 
|  | getIndexer () | 
|  | isLimitReached () | 
|  | log ($where, $force=false) | 
| 
Data Fields | 
|  | $query | 
|  | Zapytanie. 
 | 
|  | $useExpansionIfAvailable = false | 
|  | If indexer supports it, results are expanded to include items related to the first results. 
 | 
|  | $options = array() | 
|  | Additional indexer specific options for searching. 
 | 
|  | $lang | 
|  | $translationNeeded = false | 
|  | $searchMeta = false | 
|  | $order = false | 
|  | $offset = 0 | 
|  | $limit = false | 
|  | $classes = array() | 
|  | $result = null | 
|  | $resultRaw = null | 
|  | $resultCount = 0 | 
|  | $limitReached = false | 
|  | $time = 0 | 
|  | $filterCallback = null | 
|  | Callback to filter the results. 
 | 
| const | INDEXER_SQL = 'sql' | 
|  | SQL based index - queries will be executed on actual database. 
 | 
| const | INDEXER_CONTENT = 'content' | 
|  | Content based index with all searchable items. 
 | 
| 
Protected Attributes | 
|  | $queryString = null | 
|  | $indexer | 
Detailed Description
Klasa do obsługi wyszukiwania. 
$s = new KWebSearch('tekst');
$s->addAllItemTypes();
$s->run();
$list = $s->getResult();
Constructor & Destructor Documentation
      
        
          | KWebSearch::__construct | ( | $ | query, | 
        
          |  |  | $ | indexer = '', | 
        
          |  |  | array $ | options = array() | 
        
          |  | ) |  |  | 
      
 
- Parameters:
- 
  
    | $query |  |  | $indexer | - Indexer type (sql, content, lucene) or object |  
 
 
 
Member Function Documentation
      
        
          | KWebSearch::addAllItemTypes | ( |  | ) |  | 
      
 
 
      
        
          | KWebSearch::addType | ( | $ | genre, | 
        
          |  |  | $ | type | 
        
          |  | ) |  |  | 
      
 
Adds a genre/type object to this search. 
Not every indexer will use this information 
 
 
      
        
          | KWebSearch::expandQuery | ( |  | ) |  | 
      
 
Expands the query by replacing common word endings with wildcards. 
 
 
      
        
          | KWebSearch::expandWords | ( | $ | text | ) |  | 
      
 
 
      
        
          | KWebSearch::getIndexer | ( |  | ) |  | 
      
 
 
- Returns:
- string Returns query string with all the changes made by indexer and KWebSearch 
 
 
      
        
          | KWebSearch::getQueryString | ( |  | ) |  | 
      
 
Returns original query string. 
 
 
      
        
          | KWebSearch::getResult | ( | $ | start = 0, | 
        
          |  |  | $ | limit = 25, | 
        
          |  |  | $ | checkAccess = true | 
        
          |  | ) |  |  | 
      
 
Returns part of results as an array of array('obj', 'i', 'score') 
- Deprecated:
 
 
      
        
          | KWebSearch::getResultCollection | ( | $ | checkAccess = true | ) |  | 
      
 
 
      
        
          | KWebSearch::isBoolean | ( |  | ) |  | 
      
 
Returns true if the query is boolean (uses special control characters) 
 
 
      
        
          | KWebSearch::isLimitReached | ( |  | ) |  | 
      
 
 
      
        
          | KWebSearch::log | ( | $ | where, | 
        
          |  |  | $ | force = false | 
        
          |  | ) |  |  | 
      
 
 
Field Documentation
      
        
          | KWebSearch::$classes = array() | 
      
 
 
      
        
          | KWebSearch::$filterCallback = null | 
      
 
Callback to filter the results. 
Returns TRUE if the item should be shown.
boolean function(KWebSearch $search, KWebSearch_ResultItem $data) 
 
 
      
        
          | KWebSearch::$indexer  [protected] | 
      
 
 
      
        
          | KWebSearch::$limit = false | 
      
 
 
      
        
          | KWebSearch::$limitReached = false | 
      
 
 
      
        
          | KWebSearch::$options = array() | 
      
 
Additional indexer specific options for searching. 
 
 
      
        
          | KWebSearch::$order = false | 
      
 
 
      
        
          | KWebSearch::$queryString = null  [protected] | 
      
 
 
      
        
          | KWebSearch::$result = null | 
      
 
 
      
        
          | KWebSearch::$resultCount = 0 | 
      
 
 
      
        
          | KWebSearch::$resultRaw = null | 
      
 
 
      
        
          | KWebSearch::$searchMeta = false | 
      
 
 
      
        
          | KWebSearch::$translationNeeded = false | 
      
 
 
      
        
          | KWebSearch::$useExpansionIfAvailable = false | 
      
 
If indexer supports it, results are expanded to include items related to the first results. 
 
 
Content based index with all searchable items. 
 
 
SQL based index - queries will be executed on actual database. 
 
 
The documentation for this class was generated from the following file: