KWeb  6.4
KWebSearch Class Reference

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::getCount ( )
KWebSearch::getIndexer ( )
KWebSearch::getQuery ( )
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)

Creates result collection.

Returns:
KWebSearch_Result
KWebSearch::isBoolean ( )

Returns true if the query is boolean (uses special control characters)

KWebSearch::isLimitReached ( )
KWebSearch::log ( where,
force = false 
)
KWebSearch::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();.

Returns:
KWebCollection_Objects

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::$lang
KWebSearch::$limit = false
KWebSearch::$limitReached = false
KWebSearch::$offset = 0
KWebSearch::$options = array()

Additional indexer specific options for searching.

KWebSearch::$order = false
KWebSearch::$query

Zapytanie.

KWebSearch::$queryString = null [protected]
KWebSearch::$result = null
KWebSearch::$resultCount = 0
KWebSearch::$resultRaw = null
KWebSearch::$searchMeta = false
KWebSearch::$time = 0
KWebSearch::$translationNeeded = false
KWebSearch::$useExpansionIfAvailable = false

If indexer supports it, results are expanded to include items related to the first results.

const KWebSearch::INDEXER_CONTENT = 'content'

Content based index with all searchable items.

const KWebSearch::INDEXER_SQL = 'sql'

SQL based index - queries will be executed on actual database.


The documentation for this class was generated from the following file: