| 1 | package Search::Elasticsearch::Client::5_0::Direct::Indices; | ||
| 2 | $Search::Elasticsearch::Client::5_0::Direct::Indices::VERSION = '6.80_1'; # TRIAL | ||
| 3 | |||
| 4 | $Search::Elasticsearch::Client::5_0::Direct::Indices::VERSION = '6.801';use Moo; | ||
| 5 | with 'Search::Elasticsearch::Client::5_0::Role::API'; | ||
| 6 | with 'Search::Elasticsearch::Role::Client::Direct'; | ||
| 7 | __PACKAGE__->_install_api('indices'); | ||
| 8 | |||
| 9 | 1; | ||
| 10 | |||
| 11 | =pod | ||
| 12 | |||
| 13 | =encoding UTF-8 | ||
| 14 | |||
| 15 | =head1 NAME | ||
| 16 | |||
| 17 | Search::Elasticsearch::Client::5_0::Direct::Indices - A client for running index-level requests | ||
| 18 | |||
| 19 | =head1 VERSION | ||
| 20 | |||
| 21 | version 6.80_1 | ||
| 22 | |||
| 23 | =head1 DESCRIPTION | ||
| 24 | |||
| 25 | This module provides methods to make index-level requests, such as | ||
| 26 | creating and deleting indices, managing type mappings, index settings, | ||
| 27 | index templates and aliases. | ||
| 28 | |||
| 29 | It does L<Search::Elasticsearch::Role::Client::Direct>. | ||
| 30 | |||
| 31 | =head1 INDEX METHODS | ||
| 32 | |||
| 33 | =head2 C<create()> | ||
| 34 | |||
| 35 | $result = $e->indices->create( | ||
| 36 | index => 'my_index' # required | ||
| 37 | |||
| 38 | body => { # optional | ||
| 39 | index settings | ||
| 40 | mappings | ||
| 41 | aliases | ||
| 42 | } | ||
| 43 | ); | ||
| 44 | |||
| 45 | The C<create()> method is used to create an index. Optionally, index | ||
| 46 | settings, type mappings, and aliases can be added at the same time. | ||
| 47 | |||
| 48 | Query string parameters: | ||
| 49 | C<error_trace>, | ||
| 50 | C<human>, | ||
| 51 | C<master_timeout>, | ||
| 52 | C<timeout>, | ||
| 53 | C<update_all_types>, | ||
| 54 | C<wait_for_active_shards> | ||
| 55 | |||
| 56 | See the L<create index docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html> | ||
| 57 | for more information. | ||
| 58 | |||
| 59 | =head2 C<get()> | ||
| 60 | |||
| 61 | $response = $e->indices->get( | ||
| 62 | index => 'index' | \@indices # optional | ||
| 63 | feature => 'feature' | \@features # optional | ||
| 64 | ); | ||
| 65 | |||
| 66 | Returns the aliases, settings, and mappingsfor the specified indices. | ||
| 67 | The C<feature> parameter can be set to none or more of: C<_settings>, C<_mappings>, | ||
| 68 | and C<_aliases>. | ||
| 69 | |||
| 70 | See the L<get index docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-index.html>. | ||
| 71 | |||
| 72 | Query string parameters: | ||
| 73 | C<allow_no_indices>, | ||
| 74 | C<error_trace>, | ||
| 75 | C<expand_wildcards>, | ||
| 76 | C<flat_settings>, | ||
| 77 | C<human>, | ||
| 78 | C<ignore_unavailable>, | ||
| 79 | C<include_defaults>, | ||
| 80 | C<local> | ||
| 81 | |||
| 82 | =head2 C<exists()> | ||
| 83 | |||
| 84 | $bool = $e->indices->exists( | ||
| 85 | index => 'index' | \@indices # required | ||
| 86 | ); | ||
| 87 | |||
| 88 | The C<exists()> method returns C<1> or the empty string to indicate | ||
| 89 | whether the specified index or indices exist. | ||
| 90 | |||
| 91 | Query string parameters: | ||
| 92 | C<allow_no_indices>, | ||
| 93 | C<error_trace>, | ||
| 94 | C<expand_wildcards>, | ||
| 95 | C<flat_settings>, | ||
| 96 | C<human>, | ||
| 97 | C<ignore_unavailable>, | ||
| 98 | C<include_defaults>, | ||
| 99 | C<local> | ||
| 100 | |||
| 101 | See the L<index exists docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-indices-exists.html> | ||
| 102 | for more information. | ||
| 103 | |||
| 104 | =head2 C<delete()> | ||
| 105 | |||
| 106 | $response = $e->indices->delete( | ||
| 107 | index => 'index' | \@indices # required | ||
| 108 | ); | ||
| 109 | |||
| 110 | The C<delete()> method deletes the specified indices. | ||
| 111 | |||
| 112 | Query string parameters: | ||
| 113 | C<allow_no_indices>, | ||
| 114 | C<error_trace>, | ||
| 115 | C<expand_wildcards>, | ||
| 116 | C<human>, | ||
| 117 | C<ignore_unavailable>, | ||
| 118 | C<master_timeout>, | ||
| 119 | C<timeout> | ||
| 120 | |||
| 121 | See the L<delete index docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-index.html> | ||
| 122 | for more information. | ||
| 123 | |||
| 124 | =head2 C<close()> | ||
| 125 | |||
| 126 | $response = $e->indices->close( | ||
| 127 | index => 'index' | \@indices # required | ||
| 128 | ); | ||
| 129 | |||
| 130 | The C<close()> method closes the specified indices, reducing resource usage | ||
| 131 | but allowing them to be reopened later. | ||
| 132 | |||
| 133 | Query string parameters: | ||
| 134 | C<allow_no_indices>, | ||
| 135 | C<error_trace>, | ||
| 136 | C<expand_wildcards>, | ||
| 137 | C<human>, | ||
| 138 | C<ignore_unavailable> | ||
| 139 | C<master_timeout>, | ||
| 140 | C<timeout> | ||
| 141 | |||
| 142 | See the L<close index docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-open-close.html> | ||
| 143 | for more information. | ||
| 144 | |||
| 145 | =head2 C<open()> | ||
| 146 | |||
| 147 | $response = $e->indices->open( | ||
| 148 | index => 'index' | \@indices # required | ||
| 149 | ); | ||
| 150 | |||
| 151 | The C<open()> method opens closed indices. | ||
| 152 | |||
| 153 | Query string parameters: | ||
| 154 | C<allow_no_indices>, | ||
| 155 | C<error_trace>, | ||
| 156 | C<expand_wildcards>, | ||
| 157 | C<human>, | ||
| 158 | C<ignore_unavailable> | ||
| 159 | C<master_timeout>, | ||
| 160 | C<timeout> | ||
| 161 | |||
| 162 | See the L<open index docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-open-close.html> | ||
| 163 | for more information. | ||
| 164 | |||
| 165 | =head2 C<rollover()> | ||
| 166 | |||
| 167 | $response = $e->indices->rollover( | ||
| 168 | alias => $alias, # required | ||
| 169 | new_index => $index, # optional | ||
| 170 | body => { rollover conditions } # optional | ||
| 171 | ); | ||
| 172 | |||
| 173 | Rollover an index pointed to by C<alias> if it meets rollover conditions | ||
| 174 | (eg max age, max docs) to a new index name. | ||
| 175 | |||
| 176 | Query string parameters: | ||
| 177 | C<dry_run>, | ||
| 178 | C<error_trace>, | ||
| 179 | C<human>, | ||
| 180 | C<master_timeout>, | ||
| 181 | C<timeout>, | ||
| 182 | C<wait_for_active_shards> | ||
| 183 | |||
| 184 | See the L<rollover index docs|https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-rollover-index.html> | ||
| 185 | for more information. | ||
| 186 | |||
| 187 | =head2 C<shrink()> | ||
| 188 | |||
| 189 | $response = $e->shrink( | ||
| 190 | index => $index, # required | ||
| 191 | target => $target, # required | ||
| 192 | body => { mappings, settings aliases } # optional | ||
| 193 | ); | ||
| 194 | |||
| 195 | The shrink API shrinks the shards of an index down to a single shard (or to a factor | ||
| 196 | of the original shards). | ||
| 197 | |||
| 198 | Query string parameters: | ||
| 199 | C<error_trace>, | ||
| 200 | C<human>, | ||
| 201 | C<master_timeout>, | ||
| 202 | C<timeout>, | ||
| 203 | C<wait_for_active_shards> | ||
| 204 | |||
| 205 | See the L<shrink index docs|https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-shrink-index.html> | ||
| 206 | for more information. | ||
| 207 | |||
| 208 | =head2 C<clear_cache()> | ||
| 209 | |||
| 210 | $response = $e->indices->clear_cache( | ||
| 211 | index => 'index' | \@indices # optional | ||
| 212 | ); | ||
| 213 | |||
| 214 | The C<clear_cache()> method is used to clear the in-memory filter, fielddata, | ||
| 215 | or id cache for the specified indices. | ||
| 216 | |||
| 217 | Query string parameters: | ||
| 218 | C<allow_no_indices>, | ||
| 219 | C<error_trace>, | ||
| 220 | C<expand_wildcards>, | ||
| 221 | C<fielddata>, | ||
| 222 | C<fields>, | ||
| 223 | C<human>, | ||
| 224 | C<ignore_unavailable>, | ||
| 225 | C<query>, | ||
| 226 | C<recycler>, | ||
| 227 | C<request> | ||
| 228 | |||
| 229 | See the L<clear_cache docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-clearcache.html> | ||
| 230 | for more information. | ||
| 231 | |||
| 232 | =head2 C<refresh()> | ||
| 233 | |||
| 234 | $response = $e->indices->refresh( | ||
| 235 | index => 'index' | \@indices # optional | ||
| 236 | ); | ||
| 237 | |||
| 238 | The C<refresh()> method refreshes the specified indices (or all indices), | ||
| 239 | allowing recent changes to become visible to search. This process normally | ||
| 240 | happens automatically once every second by default. | ||
| 241 | |||
| 242 | Query string parameters: | ||
| 243 | C<allow_no_indices>, | ||
| 244 | C<error_trace>, | ||
| 245 | C<expand_wildcards>, | ||
| 246 | C<human>, | ||
| 247 | C<ignore_unavailable> | ||
| 248 | |||
| 249 | See the L<refresh index docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-refresh.html> | ||
| 250 | for more information. | ||
| 251 | |||
| 252 | =head2 C<flush()> | ||
| 253 | |||
| 254 | $response = $e->indices->flush( | ||
| 255 | index => 'index' | \@indices # optional | ||
| 256 | ); | ||
| 257 | |||
| 258 | The C<flush()> method causes the specified indices (or all indices) to be | ||
| 259 | written to disk with an C<fsync>, and clears out the transaction log. | ||
| 260 | This process normally happens automatically. | ||
| 261 | |||
| 262 | Query string parameters: | ||
| 263 | C<allow_no_indices>, | ||
| 264 | C<error_trace>, | ||
| 265 | C<expand_wildcards>, | ||
| 266 | C<force>, | ||
| 267 | C<human>, | ||
| 268 | C<ignore_unavailable>, | ||
| 269 | C<wait_if_ongoing> | ||
| 270 | |||
| 271 | See the L<flush index docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-flush.html> | ||
| 272 | for more information. | ||
| 273 | |||
| 274 | =head2 C<flush_synced()> | ||
| 275 | |||
| 276 | $respnse = $e->indices->flush_synced( | ||
| 277 | index => 'index' | \@indices # optional | ||
| 278 | ); | ||
| 279 | |||
| 280 | The C<flush_synced()> method does a synchronised L<flush()> on the primaries and replicas of | ||
| 281 | all the specified indices. In other words, after flushing it tries to write a C<sync_id> | ||
| 282 | on the primaries and replicas to mark them as containing the same documents. During | ||
| 283 | recovery, if a replica has the same C<sync_id> as the primary, then it doesn't need to check | ||
| 284 | whether the segment files on primary and replica are the same, and it can move on | ||
| 285 | directly to just replaying the translog. This can greatly speed up recovery. | ||
| 286 | |||
| 287 | Synced flushes happens automatically in the background on indices that have not received any | ||
| 288 | writes for a while, but the L<flush_synced()> method can be used to trigger this process | ||
| 289 | manually, eg before shutting down. Any new commits immediately break the sync. | ||
| 290 | |||
| 291 | See the L<flush synced docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-synced-flush.html> | ||
| 292 | for more information. | ||
| 293 | |||
| 294 | Query string parameters: | ||
| 295 | C<allow_no_indices>, | ||
| 296 | C<error_trace>, | ||
| 297 | C<expand_wildcards>, | ||
| 298 | C<human>, | ||
| 299 | C<ignore_unavailable> | ||
| 300 | |||
| 301 | =head2 C<forcemerge()> | ||
| 302 | |||
| 303 | $response = $e->indices->forcemerge( | ||
| 304 | index => 'index' | \@indices # optional | ||
| 305 | ); | ||
| 306 | |||
| 307 | The C<forcemerge()> method rewrites all the data in an index into at most | ||
| 308 | C<max_num_segments>. This is a very heavy operation and should only be run | ||
| 309 | with care, and only on indices that are no longer being updated. | ||
| 310 | |||
| 311 | Query string parameters: | ||
| 312 | C<allow_no_indices>, | ||
| 313 | C<error_trace>, | ||
| 314 | C<expand_wildcards>, | ||
| 315 | C<flush>, | ||
| 316 | C<human>, | ||
| 317 | C<ignore_unavailable>, | ||
| 318 | C<max_num_segments>, | ||
| 319 | C<only_expunge_deletes>, | ||
| 320 | C<wait_for_merge> | ||
| 321 | |||
| 322 | See the L<forcemerge docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-forcemerge.html> | ||
| 323 | for more information. | ||
| 324 | |||
| 325 | =head2 C<get_upgrade()> | ||
| 326 | |||
| 327 | $response = $e->indices->get_upgrade( | ||
| 328 | index => 'index' | \@indices # optional | ||
| 329 | ); | ||
| 330 | |||
| 331 | The C<get_upgrade()> method returns information about which indices need to be | ||
| 332 | upgraded, which can be done with the C<upgrade()> method. | ||
| 333 | |||
| 334 | Query string parameters: | ||
| 335 | C<allow_no_indices>, | ||
| 336 | C<error_trace>, | ||
| 337 | C<expand_wildcards>, | ||
| 338 | C<human>, | ||
| 339 | C<ignore_unavailable> | ||
| 340 | |||
| 341 | See the L<upgrade docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-upgrade.html> | ||
| 342 | for more information. | ||
| 343 | |||
| 344 | =head2 C<upgrade()> | ||
| 345 | |||
| 346 | $response = $e->indices->upgrade( | ||
| 347 | index => 'index' | \@indices # optional | ||
| 348 | ); | ||
| 349 | |||
| 350 | The C<upgrade()> method upgrades all segments in the specified indices to the latest format. | ||
| 351 | |||
| 352 | Query string parameters: | ||
| 353 | C<allow_no_indices>, | ||
| 354 | C<error_trace>, | ||
| 355 | C<expand_wildcards>, | ||
| 356 | C<human>, | ||
| 357 | C<ignore_unavailable>, | ||
| 358 | C<only_ancient_segments>, | ||
| 359 | C<wait_for_completion> | ||
| 360 | |||
| 361 | See the L<upgrade docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-upgrade.html> | ||
| 362 | for more information. | ||
| 363 | |||
| 364 | =head1 MAPPING METHODS | ||
| 365 | |||
| 366 | =head2 C<put_mapping()> | ||
| 367 | |||
| 368 | $response = $e->indices->put_mapping( | ||
| 369 | index => 'index' | \@indices # optional, | ||
| 370 | type => 'type', # required | ||
| 371 | |||
| 372 | body => { mapping } # required | ||
| 373 | ) | ||
| 374 | |||
| 375 | The C<put_mapping()> method is used to create or update a type | ||
| 376 | mapping on an existing index. Mapping updates are allowed to add new | ||
| 377 | fields, but not to overwrite or change existing fields. | ||
| 378 | |||
| 379 | For instance: | ||
| 380 | |||
| 381 | $response = $e->indices->put_mapping( | ||
| 382 | index => 'users', | ||
| 383 | type => 'user', | ||
| 384 | body => { | ||
| 385 | user => { | ||
| 386 | properties => { | ||
| 387 | name => { type => 'string' }, | ||
| 388 | age => { type => 'integer' } | ||
| 389 | } | ||
| 390 | } | ||
| 391 | } | ||
| 392 | ); | ||
| 393 | |||
| 394 | Query string parameters: | ||
| 395 | C<allow_no_indices>, | ||
| 396 | C<error_trace>, | ||
| 397 | C<expand_wildcards>, | ||
| 398 | C<human>, | ||
| 399 | C<ignore_unavailable>, | ||
| 400 | C<master_timeout>, | ||
| 401 | C<timeout>, | ||
| 402 | C<update_all_types> | ||
| 403 | |||
| 404 | See the L<put_mapping docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html> | ||
| 405 | for more information. | ||
| 406 | |||
| 407 | =head2 C<get_mapping()> | ||
| 408 | |||
| 409 | $result = $e->indices->get_mapping( | ||
| 410 | index => 'index' | \@indices # optional, | ||
| 411 | type => 'type' | \@types # optional | ||
| 412 | ); | ||
| 413 | |||
| 414 | The C<get_mapping()> method returns the type definitions for one, more or | ||
| 415 | all types in one, more or all indices. | ||
| 416 | |||
| 417 | Query string parameters: | ||
| 418 | C<allow_no_indices>, | ||
| 419 | C<error_trace>, | ||
| 420 | C<expand_wildcards>, | ||
| 421 | C<human>, | ||
| 422 | C<ignore_unavailable>, | ||
| 423 | C<local> | ||
| 424 | |||
| 425 | See the L<get_mapping docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-mapping.html> | ||
| 426 | for more information. | ||
| 427 | |||
| 428 | =head2 C<get_field_mapping()> | ||
| 429 | |||
| 430 | $result = $e->indices->get_field_mapping( | ||
| 431 | index => 'index' | \@indices # optional, | ||
| 432 | type => 'type' | \@types # optional, | ||
| 433 | fields => 'field' | \@fields # required | ||
| 434 | |||
| 435 | include_defaults => 0 | 1 | ||
| 436 | ); | ||
| 437 | |||
| 438 | The C<get_field_mapping()> method returns the field definitions for one, more or | ||
| 439 | all fields in one, more or all types and indices. | ||
| 440 | |||
| 441 | Query string parameters: | ||
| 442 | C<allow_no_indices>, | ||
| 443 | C<error_trace>, | ||
| 444 | C<expand_wildcards>, | ||
| 445 | C<human>, | ||
| 446 | C<ignore_unavailable>, | ||
| 447 | C<include_defaults>, | ||
| 448 | C<local> | ||
| 449 | |||
| 450 | See the L<get_mapping docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-field-mapping.html> | ||
| 451 | for more information. | ||
| 452 | |||
| 453 | =head2 C<exists_type()> | ||
| 454 | |||
| 455 | $bool = $e->indices->exists_type( | ||
| 456 | index => 'index' | \@indices # required, | ||
| 457 | type => 'type' | \@types # required | ||
| 458 | ); | ||
| 459 | |||
| 460 | The C<exists_type()> method checks for the existence of all specified types | ||
| 461 | in all specified indices, and returns C<1> or the empty string. | ||
| 462 | |||
| 463 | Query string parameters: | ||
| 464 | C<allow_no_indices>, | ||
| 465 | C<error_trace>, | ||
| 466 | C<expand_wildcards>, | ||
| 467 | C<human>, | ||
| 468 | C<ignore_unavailable>, | ||
| 469 | C<local> | ||
| 470 | |||
| 471 | See the L<exists_type docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-types-exists.html> | ||
| 472 | for more information. | ||
| 473 | |||
| 474 | =head1 ALIAS METHODS | ||
| 475 | |||
| 476 | =head2 C<update_aliases()> | ||
| 477 | |||
| 478 | $response = $e->indices->update_aliases( | ||
| 479 | body => { actions } # required | ||
| 480 | ); | ||
| 481 | |||
| 482 | The C<update_aliases()> method changes (by adding or removing) multiple | ||
| 483 | index aliases atomically. For instance: | ||
| 484 | |||
| 485 | $response = $e->indices->update_aliases( | ||
| 486 | body => { | ||
| 487 | actions => [ | ||
| 488 | { add => { alias => 'current', index => 'logs_2013_09' }}, | ||
| 489 | { remove => { alias => 'current', index => 'logs_2013_08' }} | ||
| 490 | ] | ||
| 491 | } | ||
| 492 | ); | ||
| 493 | |||
| 494 | Query string parameters: | ||
| 495 | C<error_trace>, | ||
| 496 | C<human>, | ||
| 497 | C<master_timeout>, | ||
| 498 | C<timeout> | ||
| 499 | |||
| 500 | See the L<update_aliases docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html> | ||
| 501 | for more information. | ||
| 502 | |||
| 503 | =head2 C<put_alias()> | ||
| 504 | |||
| 505 | $response = $e->indices->put_alias( | ||
| 506 | index => 'index' | \@indices, # required | ||
| 507 | name => 'alias', # required | ||
| 508 | |||
| 509 | body => { alias defn } # optional | ||
| 510 | ); | ||
| 511 | |||
| 512 | The C<put_alias()> method creates an index alias. For instance: | ||
| 513 | |||
| 514 | $response = $e->indices->put_alias( | ||
| 515 | index => 'my_index', | ||
| 516 | name => 'twitter', | ||
| 517 | body => { | ||
| 518 | filter => { term => { user_id => 'twitter' }} | ||
| 519 | } | ||
| 520 | ); | ||
| 521 | |||
| 522 | Query string parameters: | ||
| 523 | C<error_trace>, | ||
| 524 | C<human>, | ||
| 525 | C<master_timeout>, | ||
| 526 | C<timeout> | ||
| 527 | |||
| 528 | See the L<put_alias docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html> | ||
| 529 | for more information. | ||
| 530 | |||
| 531 | =head2 C<get_alias()> | ||
| 532 | |||
| 533 | $result = $e->indices->get_alias( | ||
| 534 | index => 'index' | \@indices, # optional | ||
| 535 | name => 'alias' | \@aliases # optional | ||
| 536 | ); | ||
| 537 | |||
| 538 | The C<get_alias()> method returns the alias definitions for the specified | ||
| 539 | aliases in the specified indices. | ||
| 540 | |||
| 541 | Query string parameters: | ||
| 542 | C<allow_no_indices>, | ||
| 543 | C<error_trace>, | ||
| 544 | C<expand_wildcards>, | ||
| 545 | C<human>, | ||
| 546 | C<ignore_unavailable>, | ||
| 547 | C<local> | ||
| 548 | |||
| 549 | See the L<get_alias docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html> | ||
| 550 | for more information. | ||
| 551 | |||
| 552 | =head2 C<exists_alias()> | ||
| 553 | |||
| 554 | $bool = $e->indices->exists_alias( | ||
| 555 | index => 'index' | \@indices, # optional | ||
| 556 | name => 'alias' | \@aliases # optional | ||
| 557 | ); | ||
| 558 | |||
| 559 | The C<exists_alias()> method returns C<1> or the empty string depending on | ||
| 560 | whether the specified aliases exist in the specified indices. | ||
| 561 | |||
| 562 | Query string parameters: | ||
| 563 | C<allow_no_indices>, | ||
| 564 | C<error_trace>, | ||
| 565 | C<expand_wildcards>, | ||
| 566 | C<human>, | ||
| 567 | C<ignore_unavailable>, | ||
| 568 | C<local> | ||
| 569 | |||
| 570 | See the L<exists_alias docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html> | ||
| 571 | for more information. | ||
| 572 | |||
| 573 | =head2 C<delete_alias()> | ||
| 574 | |||
| 575 | $response = $e->indices->delete_alias( | ||
| 576 | index => 'index' | \@indices # required, | ||
| 577 | name => 'alias' | \@aliases # required | ||
| 578 | ); | ||
| 579 | |||
| 580 | The C<delete_alias()> method deletes one or more aliases from one or more | ||
| 581 | indices. | ||
| 582 | |||
| 583 | Query string parameters: | ||
| 584 | C<error_trace>, | ||
| 585 | C<human>, | ||
| 586 | C<master_timeout>, | ||
| 587 | C<timeout> | ||
| 588 | |||
| 589 | See the L<delete_alias docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html> | ||
| 590 | for more information. | ||
| 591 | |||
| 592 | =head1 SETTINGS METHODS | ||
| 593 | |||
| 594 | =head2 C<put_settings()> | ||
| 595 | |||
| 596 | $response = $e->indices->put_settings( | ||
| 597 | index => 'index' | \@indices # optional | ||
| 598 | |||
| 599 | body => { settings } | ||
| 600 | ); | ||
| 601 | |||
| 602 | The C<put_settings()> method sets the index settings for the specified | ||
| 603 | indices or all indices. For instance: | ||
| 604 | |||
| 605 | $response = $e->indices->put_settings( | ||
| 606 | body => { | ||
| 607 | "index.refresh_interval" => -1 | ||
| 608 | } | ||
| 609 | ); | ||
| 610 | |||
| 611 | Query string parameters: | ||
| 612 | C<allow_no_indices>, | ||
| 613 | C<error_trace>, | ||
| 614 | C<expand_wildcards>, | ||
| 615 | C<flat_settings>, | ||
| 616 | C<human>, | ||
| 617 | C<ignore_unavailable>, | ||
| 618 | C<master_timeout>, | ||
| 619 | C<preserve_existing> | ||
| 620 | |||
| 621 | See the L<put_settings docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-update-settings.html> | ||
| 622 | for more information. | ||
| 623 | |||
| 624 | =head2 C<get_settings()> | ||
| 625 | |||
| 626 | $result = $e->indices->get_settings( | ||
| 627 | index => 'index' | \@indices # optional | ||
| 628 | name => 'name' | \@names # optional | ||
| 629 | ); | ||
| 630 | |||
| 631 | The C<get_settings()> method retrieves the index settings for the specified | ||
| 632 | indices or all indices. | ||
| 633 | |||
| 634 | Query string parameters: | ||
| 635 | C<allow_no_indices>, | ||
| 636 | C<error_trace>, | ||
| 637 | C<expand_wildcards>, | ||
| 638 | C<flat_settings>, | ||
| 639 | C<human>, | ||
| 640 | C<ignore_unavailable>, | ||
| 641 | C<include_defaults>, | ||
| 642 | C<local> | ||
| 643 | |||
| 644 | See the L<get_settings docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-settings.html> | ||
| 645 | for more information. | ||
| 646 | |||
| 647 | =head1 TEMPLATE METHODS | ||
| 648 | |||
| 649 | =head2 C<put_template()> | ||
| 650 | |||
| 651 | $response = $e->indices->put_template( | ||
| 652 | name => 'template' # required | ||
| 653 | body => { template defn } # required | ||
| 654 | ); | ||
| 655 | |||
| 656 | The C<put_template()> method is used to create or update index templates. | ||
| 657 | |||
| 658 | Query string parameters: | ||
| 659 | C<create>, | ||
| 660 | C<error_trace>, | ||
| 661 | C<flat_settings>, | ||
| 662 | C<human>, | ||
| 663 | C<master_timeout>, | ||
| 664 | C<op_type>, | ||
| 665 | C<order>, | ||
| 666 | C<timeout>, | ||
| 667 | C<version>, | ||
| 668 | C<version_type> | ||
| 669 | |||
| 670 | See the L<put_template docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html> | ||
| 671 | for more information. | ||
| 672 | |||
| 673 | =head2 C<get_template()> | ||
| 674 | |||
| 675 | $result = $e->indices->get_template( | ||
| 676 | name => 'template' | \@templates # optional | ||
| 677 | ); | ||
| 678 | |||
| 679 | The C<get_template()> method is used to retrieve a named template. | ||
| 680 | |||
| 681 | Query string parameters: | ||
| 682 | C<error_trace>, | ||
| 683 | C<flat_settings>, | ||
| 684 | C<human>, | ||
| 685 | C<local>, | ||
| 686 | C<master_timeout> | ||
| 687 | |||
| 688 | See the L<get_template docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html> | ||
| 689 | for more information. | ||
| 690 | |||
| 691 | =head2 C<exists_template()> | ||
| 692 | |||
| 693 | $result = $e->indices->exists_template( | ||
| 694 | name => 'template' | \@templates # required | ||
| 695 | ); | ||
| 696 | |||
| 697 | The C<exists_template()> method is used to check whether the named template exists. | ||
| 698 | |||
| 699 | Query string parameters: | ||
| 700 | C<error_trace>, | ||
| 701 | C<flat_settings>, | ||
| 702 | C<human>, | ||
| 703 | C<local>, | ||
| 704 | C<master_timeout> | ||
| 705 | |||
| 706 | See the L<get_template docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html> | ||
| 707 | for more information. | ||
| 708 | |||
| 709 | =head2 C<delete_template()> | ||
| 710 | |||
| 711 | $response = $e->indices->delete_template( | ||
| 712 | name => 'template' # required | ||
| 713 | ); | ||
| 714 | |||
| 715 | The C<delete_template()> method is used to delete a named template. | ||
| 716 | |||
| 717 | Query string parameters: | ||
| 718 | C<error_trace>, | ||
| 719 | C<human>, | ||
| 720 | C<master_timeout>, | ||
| 721 | C<timeout>, | ||
| 722 | C<version>, | ||
| 723 | C<version_type> | ||
| 724 | |||
| 725 | See the L<delete_template docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html> | ||
| 726 | for more information. | ||
| 727 | |||
| 728 | =head1 STATS METHODS | ||
| 729 | |||
| 730 | =head2 C<stats()> | ||
| 731 | |||
| 732 | $result = $e->indices->stats( | ||
| 733 | index => 'index' | \@indices # optional | ||
| 734 | metric => 'metric' | \@metrics # optional | ||
| 735 | ); | ||
| 736 | |||
| 737 | The C<stats()> method returns statistical information about one, more or all | ||
| 738 | indices. By default it returns all metrics, but you can limit which metrics | ||
| 739 | are returned by specifying the C<metric>. | ||
| 740 | |||
| 741 | Allowed metrics are: | ||
| 742 | C<_all>, | ||
| 743 | C<completion> | ||
| 744 | C<docs>, | ||
| 745 | C<fielddata>, | ||
| 746 | C<filter_cache>, | ||
| 747 | C<flush>, | ||
| 748 | C<get>, | ||
| 749 | C<id_cache>, | ||
| 750 | C<indexing>, | ||
| 751 | C<merge>, | ||
| 752 | C<percolate>, | ||
| 753 | C<query_cache>, | ||
| 754 | C<refresh>, | ||
| 755 | C<request_cache>, | ||
| 756 | C<search>, | ||
| 757 | C<segments>, | ||
| 758 | C<store> | ||
| 759 | |||
| 760 | Query string parameters: | ||
| 761 | C<completion_fields>, | ||
| 762 | C<error_trace>, | ||
| 763 | C<fielddata_fields>, | ||
| 764 | C<fields>, | ||
| 765 | C<groups>, | ||
| 766 | C<human>, | ||
| 767 | C<include_segment_file_sizes>, | ||
| 768 | C<level>, | ||
| 769 | C<types> | ||
| 770 | |||
| 771 | See the L<stats docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-stats.html> | ||
| 772 | for more information. | ||
| 773 | |||
| 774 | =head2 C<recovery()> | ||
| 775 | |||
| 776 | $result = $e->indices->recovery( | ||
| 777 | index => 'index' | \@indices # optional | ||
| 778 | ); | ||
| 779 | |||
| 780 | Provides insight into on-going shard recoveries. | ||
| 781 | |||
| 782 | Query string parameters: | ||
| 783 | C<active_only>, | ||
| 784 | C<detailed>, | ||
| 785 | C<error_trace>, | ||
| 786 | C<human> | ||
| 787 | |||
| 788 | See the L<recovery docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-recovery.html> | ||
| 789 | for more information. | ||
| 790 | |||
| 791 | =head2 C<segments()> | ||
| 792 | |||
| 793 | $result = $e->indices->segments( | ||
| 794 | index => 'index' | \@indices # optional | ||
| 795 | ); | ||
| 796 | |||
| 797 | The C<segments()> method is used to return information about the segments | ||
| 798 | that an index contains. | ||
| 799 | |||
| 800 | Query string parameters: | ||
| 801 | C<allow_no_indices>, | ||
| 802 | C<error_trace>, | ||
| 803 | C<expand_wildcards>, | ||
| 804 | C<human>, | ||
| 805 | C<ignore_unavailable>, | ||
| 806 | C<verbose> | ||
| 807 | |||
| 808 | See the L<segments docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-segments.html> | ||
| 809 | for more information. | ||
| 810 | |||
| 811 | =head2 C<shard_stores()> | ||
| 812 | |||
| 813 | $result = $e->indices->shard_stores( | ||
| 814 | index => 'index' | \@indices # optional | ||
| 815 | ); | ||
| 816 | |||
| 817 | The C<shard_stores()> method is used to find out which nodes contain | ||
| 818 | copies of which shards, whether the shards are allocated or not. | ||
| 819 | |||
| 820 | Query string parameters: | ||
| 821 | C<allow_no_indices>, | ||
| 822 | C<error_trace>, | ||
| 823 | C<expand_wildcards>, | ||
| 824 | C<human>, | ||
| 825 | C<ignore_unavailable>, | ||
| 826 | C<status> | ||
| 827 | |||
| 828 | See the L<shard_stores docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-shards-stores.html> | ||
| 829 | for more information. | ||
| 830 | |||
| 831 | =head1 QUERY AND ANALYSIS METHODS | ||
| 832 | |||
| 833 | =head2 C<analyze()> | ||
| 834 | |||
| 835 | $result = $e->indices->analyze( | ||
| 836 | index => 'index' # optional, | ||
| 837 | body => 'text to analyze' | ||
| 838 | ); | ||
| 839 | |||
| 840 | The C<analyze()> method passes the text in the C<body> through the specified | ||
| 841 | C<analyzer>, C<tokenizer> or token C<filter> - which may be global, or associated | ||
| 842 | with a particular index or field - and returns the tokens. Very useful | ||
| 843 | for debugging analyzer configurations. | ||
| 844 | |||
| 845 | Query string parameters: | ||
| 846 | C<analyzer>, | ||
| 847 | C<attributes>, | ||
| 848 | C<char_filter>, | ||
| 849 | C<error_trace>, | ||
| 850 | C<explain>, | ||
| 851 | C<field>, | ||
| 852 | C<filter>, | ||
| 853 | C<format>, | ||
| 854 | C<prefer_local>, | ||
| 855 | C<text>, | ||
| 856 | C<tokenizer> | ||
| 857 | |||
| 858 | See the L<analyze docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-analyze.html> | ||
| 859 | for more information. | ||
| 860 | |||
| 861 | =head2 C<validate_query()> | ||
| 862 | |||
| 863 | $result = $e->indices->validate_query( | ||
| 864 | index => 'index' | \@indices, # optional | ||
| 865 | type => 'type' | \@types, # optional | ||
| 866 | |||
| 867 | body => { query } | ||
| 868 | ); | ||
| 869 | |||
| 870 | The C<validate_query()> method accepts a query in the C<body> and checks | ||
| 871 | whether the query is valid or not. Most useful when C<explain> is set | ||
| 872 | to C<true>, in which case it includes an execution plan in the output. | ||
| 873 | |||
| 874 | Query string parameters: | ||
| 875 | C<all_shards>, | ||
| 876 | C<allow_no_indices>, | ||
| 877 | C<analyze_wildcard>, | ||
| 878 | C<analyzer>, | ||
| 879 | C<default_operator>, | ||
| 880 | C<df>, | ||
| 881 | C<error_trace>, | ||
| 882 | C<explain>, | ||
| 883 | C<expand_wildcards>, | ||
| 884 | C<ignore_unavailable>, | ||
| 885 | C<lenient>, | ||
| 886 | C<q>, | ||
| 887 | C<rewrite> | ||
| 888 | |||
| 889 | See the L<validate_query docs|http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-validate.html> | ||
| 890 | for more information. | ||
| 891 | |||
| 892 | =head1 AUTHOR | ||
| 893 | |||
| 894 | Enrico Zimuel <enrico.zimuel@elastic.co> | ||
| 895 | |||
| 896 | =head1 COPYRIGHT AND LICENSE | ||
| 897 | |||
| 898 | This software is Copyright (c) 2020 by Elasticsearch BV. | ||
| 899 | |||
| 900 | This is free software, licensed under: | ||
| 901 | |||
| 902 | The Apache License, Version 2.0, January 2004 | ||
| 903 | |||
| 904 | =cut | ||
| 905 | |||
| 906 | __END__ |