include/SugarSearchEngine/Elastic/Elastica/Index/Settings.php
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
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
Properties
Methods
__construct(
\Elastica_Index $index
)
:
void
Name | Type | Description |
---|---|---|
$index | \Elastica_Index | Index object |
get(
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.
Name | Type | Description |
---|---|---|
$setting | string | OPTIONAL Setting name to return |
Type | Description |
---|---|
array | string | null | Settings data |
getIndex(
)
:
\Elastica_Index
Returns the index object
Type | Description |
---|---|
\Elastica_Index | Index object |
getMergePolicy(
string $key
)
:
string
Returns the specific merge policy value
Name | Type | Description |
---|---|---|
$key | string | Merge policy key (for ex. expunge_deletes_allowed) |
Type | Description |
---|---|
string | Refresh interval |
getRefreshInterval(
)
:
string
Returns the refresh interval
If no interval is set, the default interval is returned
Type | Description |
---|---|
string | Refresh interval |
request(
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
Name | Type | Description |
---|---|---|
$data | array | OPTIONAL Data array |
$method | string | OPTIONAL Transfer method (default = Elastica_Request::GET) |
Type | Description |
---|---|
\Elastica_Response | Response object |
set(
array $data
)
:
\Elastica_Response
Can be used to set/update settings
Name | Type | Description |
---|---|---|
$data | array | Arguments |
Type | Description |
---|---|
\Elastica_Response | Response object |
setMergePolicy(
string $key, string $value
)
:
\Elastica_Response
Sets the specific merge policies
To have this changes made the index has to be closed and reopened
Name | Type | Description |
---|---|---|
$key | string | Merge policy key (for ex. expunge_deletes_allowed) |
$value | string |
Type | Description |
---|---|
\Elastica_Response |
setMergePolicyType(
string $type
)
:
\Elastica_Response
Sets merge policy
Name | Type | Description |
---|---|---|
$type | string | Merge policy type |
Type | Description |
---|---|
\Elastica_Response | Response object |
setNumberOfReplicas(
int $replicas
)
:
\Elastica_Response
Sets the number of replicas
Name | Type | Description |
---|---|---|
$replicas | int | Number of replicas |
Type | Description |
---|---|
\Elastica_Response | Response object |
setRefreshInterval(
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.
Name | Type | Description |
---|---|---|
$interval | int | Number of seconds |
Type | Description |
---|---|
\Elastica_Response | Response object |