Documentation

Search_Controller_Sphinx extends Search_Controller_Driver
in package

Search.

Tags
subpackage

Search

version
7.x
copyright

© 2005-2025, https://www.hostcms.ru

Table of Contents

Properties

$_allowedProperties  : array<string|int, mixed>
Allowed object properties
$_asObject  : string
$_config  : array<string|int, mixed>
Config
$_max_matches  : int
Sphinx Max Matches
$_propertiesValues  : array<string|int, mixed>
Properties values
$_unlimitedProperties  : bool
Object has unlimited number of properties

Methods

__construct()  : mixed
Constructor
addAllowedProperties()  : self
Add additional allowed properties
addAllowedProperty()  : self
Add additional allowed property
asObject()  : self
Set object
deleteSearchPage()  : self
Delete search page
find()  : array<string|int, mixed>
Find
getPageCount()  : string
Get pages count
indexingSearchPages()  : bool
Indexing search pages
optimize()  : self
Optimize indexed data
set()  : self
Run when writing data to inaccessible properties
setConfig()  : self
Set config
setUnlimitedProperties()  : self
Set unlimitedProperties
site()  : self
Set site. Backward compatibility, see $this->site_id
toArray()  : array<string|int, mixed>
Convert Object to Array
truncate()  : self
Remove all indexed data
_foundRows()  : self
Set found rows
_getId()  : int
Create ID by $module, $module_value_type and $module_value_id
_getReplaceQueryBuilder()  : Core_QueryBuilder_Replace
Get QueryBuilder
_prepareText()  : string
Prepare text
_quote()  : string
Quote string

Properties

$_allowedProperties

Allowed object properties

protected array<string|int, mixed> $_allowedProperties = array( 'site', // Backward compatibility 'site_id', 'offset', 'page', 'limit', 'modules', 'inner', 'total', 'orderField', // weight, datetime 'orderDirection', )

$_asObject

protected string $_asObject = 'Search_Page_Model'

$_config

Config

protected array<string|int, mixed> $_config = array()

$_max_matches

Sphinx Max Matches

protected int $_max_matches = 1000

$_propertiesValues

Properties values

protected array<string|int, mixed> $_propertiesValues = array()

$_unlimitedProperties

Object has unlimited number of properties

protected bool $_unlimitedProperties = \FALSE

Methods

__construct()

Constructor

public __construct(array<string|int, mixed> $aConfig) : mixed
Parameters
$aConfig : array<string|int, mixed>

addAllowedProperties()

Add additional allowed properties

public addAllowedProperties(array<string|int, mixed> $array) : self
Parameters
$array : array<string|int, mixed>

array of properties' names

Return values
self

addAllowedProperty()

Add additional allowed property

public addAllowedProperty(string $property) : self
Parameters
$property : string

property name

Return values
self

asObject()

Set object

public asObject(mixed $objectName) : self
Parameters
$objectName : mixed
Return values
self

deleteSearchPage()

Delete search page

public deleteSearchPage(int $site_id, int $module, int $module_value_type, int $module_value_id) : self
Parameters
$site_id : int
$module : int

module's number, 0-15

$module_value_type : int

value type, 0-15

$module_value_id : int

entity id, 0-16777216

Return values
self

find()

Find

public find(string $query) : array<string|int, mixed>
Parameters
$query : string

Search query

Tags
hostcms-event

Search_Controller_Sphinx.onBeforeExecuteFind

Return values
array<string|int, mixed>

Array of Search_Page_Model

getPageCount()

Get pages count

public getPageCount(int $site_id) : string
Parameters
$site_id : int

site ID

Return values
string

count of pages

indexingSearchPages()

Indexing search pages

public indexingSearchPages(array<string|int, mixed> $aPages) : bool
Parameters
$aPages : array<string|int, mixed>

list of search pages

Tags
hostcms-event

Search_Controller_Sphinx.onAfterPrepareQueryBuilder

hostcms-event

Search_Controller_Sphinx.onAfterPrepareValues

Return values
bool

optimize()

Optimize indexed data

public optimize(int $site_id) : self
Parameters
$site_id : int

Site ID

Return values
self

set()

Run when writing data to inaccessible properties

public set(string $property, string $value) : self
Parameters
$property : string

property name

$value : string

property value

Return values
self

setConfig()

Set config

public setConfig(array<string|int, mixed> $aConfig) : self
Parameters
$aConfig : array<string|int, mixed>
Return values
self

setUnlimitedProperties()

Set unlimitedProperties

public setUnlimitedProperties([bool $value = TRUE ]) : self
Parameters
$value : bool = TRUE

default TRUR

Return values
self

site()

Set site. Backward compatibility, see $this->site_id

public site(Site_Model $oSite) : self
Parameters
$oSite : Site_Model
Return values
self

toArray()

Convert Object to Array

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

truncate()

Remove all indexed data

public truncate(int $site_id) : self
Parameters
$site_id : int

Site ID

Return values
self

_foundRows()

Set found rows

protected _foundRows() : self
Return values
self

_getId()

Create ID by $module, $module_value_type and $module_value_id

protected _getId(int $module, int $module_value_type, int $module_value_id) : int
Parameters
$module : int

module's number, 0-15

$module_value_type : int

value type, 0-15

$module_value_id : int

entity id, 0-16777216

Return values
int

_prepareText()

Prepare text

protected _prepareText(string $text) : string
Parameters
$text : string
Return values
string

_quote()

Quote string

protected _quote(string $string) : string
Parameters
$string : string
Return values
string

        
On this page

Search results