include/SugarSearchEngine/Elastic/Elastica/Index/Settings.php

Show: inherited
Table of Contents

Elastica index settings object

All settings listed in the update settings API (http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings.html) can be changed on a running indice. To make changes like the merge policy (http://www.elasticsearch.org/guide/reference/index-modules/merge.html) the index has to be closed first and reopened after the call

Author
Nicolas Ruflin  
Category
Xodoa  
Link
http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings.html  
Link
http://www.elasticsearch.org/guide/reference/index-modules/merge.html  
Package
Elastica  

\Elastica_Index_Settings

Package: Elastica

Elastica index settings object

All settings listed in the update settings API (http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings.html) can be changed on a running indice. To make changes like the merge policy (http://www.elasticsearch.org/guide/reference/index-modules/merge.html) the index has to be closed first and reopened after the call

Author
Nicolas Ruflin  
Category
Xodoa  
Link
http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings.html  
Link
http://www.elasticsearch.org/guide/reference/index-modules/merge.html  

Constants

Constant  DEFAULT_REFRESH_INTERVAL = '1s'

Properties

Propertyprotected  $_data= 'array()'
Default valuearray()Details
Type
n/a
Propertyprotected  $_name= ''''
Default value''Details
Type
n/a
Propertyprotected  $_response= 'null'
Default valuenullDetails
Type
n/a

Methods

methodpublic__construct( \Elastica_Index $index ) : void

Parameters
Name Type Description
$index \Elastica_Index

Index object

methodpublicget( string $setting = '' ) : array | string | null

Returns the current settings of the index

If param is set, only specified setting is return. 'index.' is added in front of $setting.

Parameters
Name Type Description
$setting string

OPTIONAL Setting name to return

Returns
Type Description
array | string | null Settings data
Details
Link
http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings.html  
methodpublicgetIndex( ) : \Elastica_Index

Returns the index object

Returns
Type Description
\Elastica_Index Index object
methodpublicgetMergePolicy( string $key ) : string

Returns the specific merge policy value

Parameters
Name Type Description
$key string

Merge policy key (for ex. expunge_deletes_allowed)

Returns
Type Description
string Refresh interval
Details
Link
http://www.elasticsearch.org/guide/reference/index-modules/merge.html  
methodpublicgetMergePolicyType( ) : string

Returns
Type Description
string Merge policy type
methodpublicgetRefreshInterval( ) : string

Returns the refresh interval

If no interval is set, the default interval is returned

Returns
Type Description
string Refresh interval
methodpublicrequest( array $data = array(), string $method = Elastica_Request::GET ) : \Elastica_Response

Updates the given settings for the index

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

Parameters
Name Type Description
$data array

OPTIONAL Data array

$method string

OPTIONAL Transfer method (default = Elastica_Request::GET)

Returns
Type Description
\Elastica_Response Response object
methodpublicset( array $data ) : \Elastica_Response

Can be used to set/update settings

Parameters
Name Type Description
$data array

Arguments

Returns
Type Description
\Elastica_Response Response object
methodpublicsetMergePolicy( string $key, string $value ) : \Elastica_Response

Sets the specific merge policies

To have this changes made the index has to be closed and reopened

Parameters
Name Type Description
$key string

Merge policy key (for ex. expunge_deletes_allowed)

$value string
Returns
Type Description
\Elastica_Response
Details
Link
http://www.elasticsearch.org/guide/reference/index-modules/merge.html  
methodpublicsetMergePolicyType( string $type ) : \Elastica_Response

Sets merge policy

Parameters
Name Type Description
$type string

Merge policy type

Returns
Type Description
\Elastica_Response Response object
Details
Link
http://www.elasticsearch.org/guide/reference/index-modules/merge.html  
methodpublicsetNumberOfReplicas( int $replicas ) : \Elastica_Response

Sets the number of replicas

Parameters
Name Type Description
$replicas int

Number of replicas

Returns
Type Description
\Elastica_Response Response object
methodpublicsetRefreshInterval( int $interval ) : \Elastica_Response

Sets the index refresh interval

Value can be for example 3s for 3 seconds or 5m for 5 minutes. -1 refreshing is disabled.

Parameters
Name Type Description
$interval int

Number of seconds

Returns
Type Description
\Elastica_Response Response object
Documentation was generated by DocBlox 0.18.1.