Class humhub\modules\search\engine\ZendLuceneSearch

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

ZendLucenceSearch Engine

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$index \ZendSearch\Lucene\SearchIndexInterface The lucence index humhub\modules\search\engine\ZendLuceneSearch
$minQueryTokenLength integer The minimum length of a search token humhub\modules\search\engine\Search
$searchItemLimit integer Sets the termsPerQueryLimit property for the lucene index. humhub\modules\search\engine\ZendLuceneSearch


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

$index public property

The lucence index

public \ZendSearch\Lucene\SearchIndexInterface $index null
$searchItemLimit public property

Sets the termsPerQueryLimit property for the lucene index. This limits the number of terms in a search query, which also results in a limitation of the number of items a search term can match.

This property should be at least as high as the number of items a search can match. It needs to be configured dependent on the amount of items stored in the Humhub database.

It can be set to 0 for no limitation, but that may result in search queries to fail caused by high memory usage.

Defaults to 2048, which is twice as high as the default value set by Lucene.

See also \ZendSearch\Lucene\Lucene::getTermsPerQueryLimit().

public integer $searchItemLimit 2048

Method Details

add() public method

Stores an object in search index.

public void add ( humhub\modules\search\interfaces\Searchable $obj )
buildQuery() protected method

Returns the lucence search query

protected \ZendSearch\Lucene\Search\Query\AbstractQuery buildQuery ( $keyword, $options )
$keyword string
$options array
delete() public method

public void delete ( humhub\modules\search\interfaces\Searchable $obj )
deleteRecord() public method

public void deleteRecord ( $className, $primaryKey )
find() public method

public void find ( $keyword, array $options )
flush() public method

public void flush ( )
getIndex() protected method

protected void getIndex ( )
getIndexPath() protected method

protected void getIndexPath ( )
optimize() public method

public void optimize ( )
update() public method

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