PHP Класс Elastica\Index\Settings

All settings listed in the update settings API (https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-update-settings.html) can be changed on a running indices. To make changes like the merge policy (https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules-merge.html) the index has to be closed first and reopened after the call
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_data Stats info.
$_index Index.
$_response Response.

Открытые методы

Метод Описание
__construct ( Index $index ) Construct.
get ( string $setting = '' ) : array | string | null Returns the current settings of the index.
getBlocksMetadata ( ) : boolean
getBlocksRead ( ) : boolean
getBlocksWrite ( ) : boolean
getIndex ( ) : Index Returns the index object.
getMergePolicy ( string $key ) : string Returns the specific merge policy value.
getReadOnly ( ) : boolean getReadOnly.
getRefreshInterval ( ) : string Returns the refresh interval.
request ( array $data = [], string $method = Request::GET ) : Response Updates the given settings for the index.
set ( array $data ) : Response Can be used to set/update settings.
setBlocksMetadata ( boolean $state = true ) : Response
setBlocksRead ( boolean $state = true ) : Response
setBlocksWrite ( boolean $state = true ) : Response
setMergePolicy ( string $key, string $value ) : Response Sets the specific merge policies.
setNumberOfReplicas ( integer $replicas ) : Response Sets the number of replicas.
setReadOnly ( boolean $readOnly = true ) : Response Sets the index to read only.
setRefreshInterval ( integer $interval ) : Response Sets the index refresh interval.

Описание методов

__construct() публичный Метод

Construct.
public __construct ( Index $index )
$index Elastica\Index Index object

get() публичный Метод

If param is set, only specified setting is return. 'index.' is added in front of $setting.
public get ( string $setting = '' ) : array | string | null
$setting string OPTIONAL Setting name to return
Результат array | string | null Settings data

getBlocksMetadata() публичный Метод

public getBlocksMetadata ( ) : boolean
Результат boolean

getBlocksRead() публичный Метод

public getBlocksRead ( ) : boolean
Результат boolean

getBlocksWrite() публичный Метод

public getBlocksWrite ( ) : boolean
Результат boolean

getIndex() публичный Метод

Returns the index object.
public getIndex ( ) : Index
Результат Elastica\Index Index object

getMergePolicy() публичный Метод

Returns the specific merge policy value.
public getMergePolicy ( string $key ) : string
$key string Merge policy key (for ex. expunge_deletes_allowed)
Результат string Refresh interval

getReadOnly() публичный Метод

getReadOnly.
public getReadOnly ( ) : boolean
Результат boolean

getRefreshInterval() публичный Метод

If no interval is set, the default interval is returned
public getRefreshInterval ( ) : string
Результат string Refresh interval

request() публичный Метод

With elasticsearch 0.16 the following settings are supported - index.term_index_interval - index.term_index_divisor - index.translog.flush_threshold_ops - index.translog.flush_threshold_size - index.translog.flush_threshold_period - index.refresh_interval - index.merge.policy - index.auto_expand_replicas
public request ( array $data = [], string $method = Request::GET ) : Response
$data array OPTIONAL Data array
$method string OPTIONAL Transfer method (default = \Elastica\Request::GET)
Результат Elastica\Response Response object

set() публичный Метод

Can be used to set/update settings.
public set ( array $data ) : Response
$data array Arguments
Результат Elastica\Response Response object

setBlocksMetadata() публичный Метод

public setBlocksMetadata ( boolean $state = true ) : Response
$state boolean OPTIONAL (default = true)
Результат Elastica\Response

setBlocksRead() публичный Метод

public setBlocksRead ( boolean $state = true ) : Response
$state boolean OPTIONAL (default = true)
Результат Elastica\Response

setBlocksWrite() публичный Метод

public setBlocksWrite ( boolean $state = true ) : Response
$state boolean OPTIONAL (default = true)
Результат Elastica\Response

setMergePolicy() публичный Метод

To have this changes made the index has to be closed and reopened
public setMergePolicy ( string $key, string $value ) : Response
$key string Merge policy key (for ex. expunge_deletes_allowed)
$value string
Результат Elastica\Response

setNumberOfReplicas() публичный Метод

Sets the number of replicas.
public setNumberOfReplicas ( integer $replicas ) : Response
$replicas integer Number of replicas
Результат Elastica\Response Response object

setReadOnly() публичный Метод

Sets the index to read only.
public setReadOnly ( boolean $readOnly = true ) : Response
$readOnly boolean (default = true)
Результат Elastica\Response

setRefreshInterval() публичный Метод

Value can be for example 3s for 3 seconds or 5m for 5 minutes. -1 refreshing is disabled.
public setRefreshInterval ( integer $interval ) : Response
$interval integer Number of milliseconds
Результат Elastica\Response Response object

Описание свойств

$_data защищенное свойство

Stats info.
protected $_data

$_index защищенное свойство

Index.
protected $_index

$_response защищенное свойство

Response.
protected $_response