Abstract Class humhub\modules\search\engine\Search

Inheritancehumhub\modules\search\engine\Search » yii\base\Component
Subclasseshumhub\modules\search\engine\ZendLuceneSearch
Available since version0.12

Description of HSearchComponent

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$minQueryTokenLength integer The minimum length of a search token humhub\modules\search\engine\Search

Public Methods

Hide inherited methods

MethodDescriptionDefined By
add() Stores an object in search index. humhub\modules\search\engine\Search
delete() Deletes an object from search. humhub\modules\search\engine\Search
find() Retrieves results from search humhub\modules\search\engine\Search
flush() Deletes all objects from search index. humhub\modules\search\engine\Search
optimize() Optimizes the search index. humhub\modules\search\engine\Search
rebuild() Rebuilds search index humhub\modules\search\engine\Search
update() Updates an object in search index. humhub\modules\search\engine\Search

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
DOCUMENT_TYPE_CONTENT 'content' humhub\modules\search\engine\Search
DOCUMENT_TYPE_OTHER 'other' humhub\modules\search\engine\Search
DOCUMENT_TYPE_SPACE 'space' humhub\modules\search\engine\Search
DOCUMENT_TYPE_USER 'user' humhub\modules\search\engine\Search
DOCUMENT_VISIBILITY_PRIVATE 'private' humhub\modules\search\engine\Search
DOCUMENT_VISIBILITY_PUBLIC 'public' humhub\modules\search\engine\Search
EVENT_ON_REBUILD 'onRebuild' humhub\modules\search\engine\Search
EVENT_SEARCH_ATTRIBUTES 'search_attributes' humhub\modules\search\engine\Search

Property Details

$minQueryTokenLength public property

The minimum length of a search token

Method Details

add() public abstract method

Stores an object in search index.

public abstract void add ( humhub\modules\search\interfaces\Searchable $object )
$object humhub\modules\search\interfaces\Searchable
delete() public abstract method

Deletes an object from search.

public abstract void delete ( humhub\modules\search\interfaces\Searchable $object )
$object humhub\modules\search\interfaces\Searchable
find() public abstract method

Retrieves results from search

Available options:

 page
 pageSize

 sortField           Mixed String/Array
 model               Mixed String/Array
 type                Mixed String/Array
 checkPermissions    boolean (TRUE/false)
 limitSpaces         Array (Limit Content to given Spaces(
 filters             Array (Additional filter Field=>Value)
public abstract \humhub\modules\search\engine\SearchResultSet find ( $query, array $options )
$query \humhub\modules\search\engine\type
$options array
flush() public abstract method

Deletes all objects from search index.

public abstract void flush ( )
getAdditionalAttributes() protected method

Returns additional search attributes for the given object.

This contains a list of comments, files and other content addons.

protected array getAdditionalAttributes ( humhub\modules\search\interfaces\Searchable $object )
$object humhub\modules\search\interfaces\Searchable
return array

The additional search attributes

getDocumentType() protected method

protected void getDocumentType ( humhub\modules\search\interfaces\Searchable $obj )
$obj
getMetaInfoArray() protected method

protected void getMetaInfoArray ( humhub\modules\search\interfaces\Searchable $obj )
$obj
optimize() public method

Optimizes the search index.

Default implementation does nothing, may be overidden by child classes.

public void optimize ( )
rebuild() public method

Rebuilds search index

public void rebuild ( )
setDefaultFindOptions() protected method

protected void setDefaultFindOptions ( $options )
$options
update() public abstract method

Updates an object in search index.

public abstract void update ( humhub\modules\search\interfaces\Searchable $object )
$object humhub\modules\search\interfaces\Searchable