Class cSearchResult
CONTENIDO API - SearchResult Object
This object ranks and displays the result of the indexed fulltext search. If you are not comfortable with this API feel free to use your own methods to display the search results. The search result is basically an array with article ID's.
If $search_result = $search->searchIndex($searchword, $searchwordex);
use object with
$oSearchResults = new cSearchResult($search_result, 10);
// html-tags to emphasize the located searchwords $oSearchResults->setReplacement('<span style="color:red">', '</span>');
$num_res = $oSearchResults->getNumberOfResults(); $num_pages = $oSearchResults->getNumberOfPages(); // first result page $res_page = $oSearchResults->getSearchResultPage(1);
foreach ($res_page as $key => $val) { $headline = $oSearchResults->getSearchContent($key, 'HTMLHEAD'); $first_headline = $headline[0]; $text = $oSearchResults->getSearchContent($key, 'HTML'); $first_text = $text[0]; $similarity = $oSearchResults->getSimilarity($key); $iOccurrence = $oSearchResults->getOccurrence($key); }
- cSearchBaseAbstract
- cSearchResult
Copyright: four for business AG <www.4fb.de>
License: http://www.contenido.org/license/LIZENZ.txt
Author: Willi Man
Located at classes/search/class.search.result.php
public
|
#
__construct( array $search_result, integer $result_per_page,
Constructor to create an instance of this class. |
public
|
|
public
string
|
|
public
string
|
|
public
array
|
|
public
integer
|
|
public
integer
|
|
public
integer
|
|
public
integer
|
|
public
|
|
public
integer
|
_debug()
|
protected
object
|
$_index |
|
#
Instance of class Index |
protected
integer
|
$_results |
|
#
Number of results |
protected
integer
|
$_pages |
|
#
Number of result pages |
protected
integer
|
$_resultPage |
|
#
Current result page |
protected
integer
|
$_resultPerPage |
|
#
Results per page to display |
protected
array
|
$_replacement | array() |
#
Array of html-tags to emphasize the searchwords |
protected
array
|
$_rankStructure | array() |
#
Array of article id's with ranking information |
protected
array
|
$_orderedSearchResult | array() |
#
Array of result-pages with array's of article id's |
protected
array
|
$_searchResult | array() |
#
Array of article id's with information about cms-types, occurence of keyword/searchword, similarity . |
$cfg,
$client,
$lang,
$oDB
|