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