0_90/Direct/Indices.pm untested

filter: Statementstmt 0.0% 0 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 1 Podpod n/a totaltotal 0.0% 0 / 10 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
CRAP 2.0
1 # Licensed to Elasticsearch B.V under one or more agreements.
2 # Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3 # See the LICENSE file in the project root for more information
4  
5 package Search::Elasticsearch::Client::0_90::Direct::Indices;
6 $Search::Elasticsearch::Client::0_90::Direct::Indices::VERSION = '7.30_1'; # TRIAL
7  
8 $Search::Elasticsearch::Client::0_90::Direct::Indices::VERSION = '7.301';
9 use Moo;
10 with 'Search::Elasticsearch::Client::0_90::Role::API';
11 with 'Search::Elasticsearch::Role::Client::Direct';
12 __PACKAGE__->_install_api('indices');
13  
14 1;
15  
16 =pod
17  
18 =encoding UTF-8
19  
20 =head1 NAME
21  
22 Search::Elasticsearch::Client::0_90::Direct::Indices - A client for running index-level requests
23  
24 =head1 VERSION
25  
26 version 7.30_1
27  
28 =head1 DESCRIPTION
29  
30 This module provides methods to make index-level requests, such as
31 creating and deleting indices, managing type mappings, index settings,
32 warmers, index templates and aliases.
33  
34 It does L<Search::Elasticsearch::Role::Client::Direct>.
35  
36 =head1 INDEX METHODS
37  
38 =head2 C<create()>
39  
40 $result = $e->indices->create(
41 index => 'my_index' # required
42  
43 body => { # optional
44 index settings
45 mappings
46 warmers
47 }
48 );
49  
50 The C<create()> method is used to create an index. Optionally, index
51 settings, type mappings and index warmers can be added at the same time.
52  
53 Query string parameters:
54 C<master_timeout>,
55 C<timeout>
56  
57 See the L<create index docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-create-index.html>
58 for more information.
59  
60 =head2 C<exists()>
61  
62 $bool = $e->indices->exists(
63 index => 'index' | \@indices # required
64 );
65  
66 The C<exists()> method returns C<1> or the empty string to indicate
67 whether the specified index or indices exist.
68  
69 See the L<index exists docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-indices-exists.html>
70 for more information.
71  
72 =head2 C<delete()>
73  
74 $response = $e->indices->delete(
75 index => 'index' | \@indices # required
76 );
77  
78 The C<delete()> method deletes the specified indices.
79  
80 Query string parameters:
81 C<master_timeout>,
82 C<timeout>
83  
84 See the L<delete index docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-delete-index.html>
85 for more information.
86  
87 =head2 C<close()>
88  
89 $response = $e->indices->close(
90 index => 'index' | \@indices # required
91 );
92  
93 The C<close()> method closes the specified indices, reducing resource usage
94 but allowing them to be reopened later.
95  
96 Query string parameters:
97 C<master_timeout>,
98 C<timeout>
99  
100 See the L<close index docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-open-close.html>
101 for more information.
102  
103 =head2 C<open()>
104  
105 $response = $e->indices->open(
106 index => 'index' | \@indices # optional
107 );
108  
109 The C<open()> method opens closed indices.
110  
111 Query string parameters:
112 C<master_timeout>,
113 C<timeout>
114  
115 See the L<open index docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-open-close.html>
116 for more information.
117  
118 =head2 C<clear_cache()>
119  
120 $response = $e->indices->clear_cache(
121 index => 'index' | \@indices # optional
122 );
123  
124 The C<clear_cache()> method is used to clear the in-memory filter, fielddata,
125 or id cache for the specified indices.
126  
127 Query string parameters:
128 C<allow_no_indices>,
129 C<expand_wildcards>,
130 C<fielddata>,
131 C<fields>,
132 C<filter>,
133 C<filter_cache>,
134 C<filter_keys>,
135 C<id>,
136 C<ignore_indices>,
137 C<ignore_unavailable>,
138 C<index>,
139 C<recycler>
140  
141 See the L<clear_cache docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-clearcache.html>
142 for more information.
143  
144 =head2 C<refresh()>
145  
146 $response = $e->indices->refresh(
147 index => 'index' | \@indices # optional
148 );
149  
150 The C<refresh()> method refreshes the specified indices (or all indices),
151 allowing recent changes to become visible to search. This process normally
152 happens automatically once every second by default.
153  
154 Query string parameters:
155 C<allow_no_indices>,
156 C<expand_wildcards>,
157 C<ignore_indices>,
158 C<ignore_unavailable>
159  
160 See the L<refresh index docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-refresh.html>
161 for more information.
162  
163 =head2 C<flush()>
164  
165 $response = $e->indices->flush(
166 index => 'index' | \@indices # optional
167 );
168  
169 The C<flush()> method causes the specified indices (or all indices) to be
170 written to disk with an C<fsync>, and clears out the transaction log.
171 This process normally happens automatically.
172  
173 Query string parameters:
174 C<allow_no_indices>,
175 C<expand_wildcards>,
176 C<force>,
177 C<full>,
178 C<ignore_indices>,
179 C<ignore_unavailable>,
180 C<refresh>
181  
182 See the L<flush index docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-flush.html>
183 for more information.
184  
185 =head2 C<optimize()>
186  
187 $response = $e->indices->optimize(
188 index => 'index' | \@indices # optional
189 );
190  
191 The C<optimize()> method rewrites all the data in an index into at most
192 C<max_num_segments>. This is a very heavy operation and should only be run
193 with care, and only on indices that are no longer being updated.
194  
195 Query string parameters:
196 C<allow_no_indices>,
197 C<expand_wildcards>,
198 C<flush>,
199 C<ignore_indices>,
200 C<ignore_unavailable>,
201 C<max_num_segments>,
202 C<only_expunge_deletes>,
203 C<refresh>,
204 C<wait_for_merge>
205  
206 See the L<optimize index docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-optimize.html>
207 for more information.
208  
209 =head2 C<snapshot_index()>
210  
211 $response = $e->indices->snapshot_index(
212 index => 'index' | \@indices # optional
213 );
214  
215 Deprecated.
216  
217 See the L<snapshot_index docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/>
218 for more information.
219  
220 =head1 MAPPING METHODS
221  
222 =head2 C<put_mapping()>
223  
224 $response = $e->indices->put_mapping(
225 index => 'index' | \@indices # optional,
226 type => 'type', # required
227  
228 body => { mapping } # required
229 )
230  
231 The C<put_mapping()> method is used to create or update a type
232 mapping on an existing index. Mapping updates are allowed to add new
233 fields, but not to overwrite or change existing fields.
234  
235 For instance:
236  
237 $response = $e->indices->put_mapping(
238 index => 'users',
239 type => 'user',
240 body => {
241 user => {
242 properties => {
243 name => { type => 'string' },
244 age => { type => 'integer' }
245 }
246 }
247 }
248 );
249  
250 Query string parameters:
251 C<ignore_conflicts>,
252 C<master_timeout>,
253 C<timeout>
254  
255 See the L<put_mapping docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-put-mapping.html>
256 for more information.
257  
258 =head2 C<get_mapping()>
259  
260 $result = $e->indices->get_mapping(
261 index => 'index' | \@indices # optional,
262 type => 'type' | \@types # optional
263 );
264  
265 The C<get_mapping()> method returns the type definitions for one, more or
266 all types in one, more or all indices.
267  
268 See the L<get_mapping docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-get-mapping.html>
269 for more information.
270  
271 =head2 C<get_field_mapping()>
272  
273 $result = $e->indices->get_field_mapping(
274 index => 'index' | \@indices # optional,
275 type => 'type' | \@types # optional,
276 field => 'field' | \@fields # required
277  
278 include_defaults => 0 | 1
279 );
280  
281 The C<get_field_mapping()> method returns the field definitions for one, more or
282 all fields in one, more or all types and indices.
283  
284 See the L<get_mapping docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-get-field-mapping.html>
285 for more information.
286  
287 =head2 C<exists_type()>
288  
289 $bool = $e->indices->exists_type(
290 index => 'index' | \@indices # optional,
291 type => 'type' | \@types # required
292 );
293  
294 The C<exists_type()> method checks for the existence of all specified types
295 in all specified indices, and returns C<1> or the empty string.
296  
297 Query string parameters:
298 C<allow_no_indices>,
299 C<expand_wildcards>,
300 C<ignore_indices>,
301 C<ignore_unavailable>
302  
303 See the L<exists_type docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-types-exists.html>
304 for more information.
305  
306 =head2 C<delete_mapping()>
307  
308 $response = $e->indices->delete_mapping(
309 index => 'index' | \@indices # required,
310 type => 'type' # required
311 );
312  
313 The C<delete_mapping()> method deletes the type mappings (and all documents of
314 that type) in all specified indices.
315  
316 Query string parameters:
317 C<master_timeout>
318  
319 See the L<delete_mapping docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-delete-mapping.html>
320 for more information.
321  
322 =head1 ALIAS METHODS
323  
324 =head2 C<update_aliases()>
325  
326 $response = $e->indices->update_aliases(
327 body => { actions } # required
328 );
329  
330 The C<update_aliases()> method changes (by adding or removing) multiple
331 index aliases atomically. For instance:
332  
333 $response = $e->indices->update_aliases(
334 body => {
335 actions => [
336 { add => { alias => 'current', index => 'logs_2013_09' }},
337 { remove => { alias => 'current', index => 'logs_2013_08' }}
338 ]
339 }
340 );
341  
342 Query string parameters:
343 C<master_timeout>,
344 C<timeout>
345  
346 See the L<update_aliases docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-aliases.html>
347 for more information.
348  
349 =head2 C<get_aliases()>
350  
351 The C<get_aliases()> method is deprecated in favour of L</get_alias()>.
352  
353 $result = $e->indices->get_aliases(
354 index => 'index' | \@indices # optional
355 );
356  
357 The C<get_aliases()> method returns a list of aliases per index for all
358 the specified indices.
359  
360 Query string parameters:
361 C<timeout>
362  
363 See the L<get_aliases docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-aliases.html>
364 for more information.
365  
366 =head2 C<put_alias()>
367  
368 $response = $e->indices->put_alias(
369 index => 'index', # required
370 name => 'alias', # required
371  
372 body => { alias defn } # optional
373 );
374  
375 The C<put_alias()> method creates a single index alias. For instance:
376  
377 $response = $e->indices->put_alias(
378 index => 'my_index',
379 name => 'twitter',
380 body => {
381 filter => { term => { user_id => 'twitter' }}
382 }
383 );
384  
385 Query string parameters:
386 C<master_timeout>,
387 C<timeout>
388  
389 See the L<put_alias docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-aliases.html>
390 for more information.
391  
392 =head2 C<get_alias()>
393  
394 $result = $e->indices->get_alias(
395 index => 'index' | \@indices, # optional
396 name => 'alias' | \@aliases # optional
397 );
398  
399 The C<get_alias()> method returns the alias definitions for the specified
400 aliases in the specified indices.
401  
402 Query string parameters:
403 C<allow_no_indices>,
404 C<expand_wildcards>,
405 C<ignore_indices>,
406 C<ignore_unavailable>
407  
408 See the L<get_alias docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-aliases.html>
409 for more information.
410  
411 =head2 C<exists_alias()>
412  
413 $bool = $e->indices->exists_alias(
414 index => 'index' | \@indices, # optional
415 name => 'alias' | \@aliases # optional
416 );
417  
418 The C<exists_alias()> method returns C<1> or the empty string depending on
419 whether the specified aliases exist in the specified indices.
420  
421 Query string parameters:
422 C<allow_no_indices>,
423 C<expand_wildcards>,
424 C<ignore_indices>,
425 C<ignore_unavailable>
426  
427 See the L<exists_alias docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-aliases.html>
428 for more information.
429  
430 =head2 C<delete_alias()>
431  
432 $response = $e->indices->delete_alias(
433 index => 'index', # required
434 name => 'alias' # required
435 );
436  
437 The C<delete_alias()> method deletes a single alias in a single index.
438  
439 Query string parameters:
440 C<master_timeout>,
441 C<timeout>
442  
443 See the L<delete_alias docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-aliases.html>
444 for more information.
445  
446 =head1 SETTINGS METHODS
447  
448 =head2 C<put_settings()>
449  
450 $response = $e->indices->get_settings(
451 index => 'index' | \@indices # optional
452  
453 body => { settings }
454 );
455  
456 The C<put_settings()> method sets the index settings for the specified
457 indices or all indices. For instance:
458  
459 $response = $e->indices->put_settings(
460 body => {
461 "index.refresh_interval" => -1
462 }
463 );
464  
465 Query string parameters:
466 C<master_timeout>
467  
468 See the L<put_settings docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-update-settings.html>
469 for more information.
470  
471 =head2 C<get_settings()>
472  
473 $result = $e->indices->get_settings(
474 index => 'index' | \@indices # optional
475 );
476  
477 The C<get_settings()> method retrieves the index settings for the specified
478 indices or all indices.
479  
480 See the L<get_settings docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-get-settings.html>
481 for more information.
482  
483 =head1 TEMPLATE METHODS
484  
485 =head2 C<put_template()>
486  
487 $response = $e->indices->put_template(
488 name => 'template' # required
489 body => { template defn } # required
490 );
491  
492 The C<put_template()> method is used to create or update index templates.
493  
494 Query string parameters:
495 C<master_timeout>,
496 C<order>,
497 C<timeout>
498  
499 See the L<put_template docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-templates.html>
500 for more information.
501  
502 =head2 C<get_template()>
503  
504 $result = $e->indices->get_template(
505 name => 'template' # required
506 );
507  
508 The C<get_template()> method is used to retrieve a named template.
509  
510 See the L<get_template docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-templates.html>
511 for more information.
512  
513 =head2 C<delete_template()>
514  
515 $response = $e->indices->delete_template(
516 name => 'template' # required
517 );
518  
519 The C<delete_template()> method is used to delete a named template.
520  
521 Query string parameters:
522 C<master_timeout>,
523 C<timeout>
524  
525 See the L<delete_template docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-templates.html>
526 for more information.
527  
528 =head1 WARMER METHODS
529  
530 =head2 C<put_warmer()>
531  
532 $response = $e->indices->put_warmer(
533 index => 'index' | \@indices, # optional
534 name => 'warmer', # required
535  
536 body => { warmer defn } # required
537 );
538  
539 The C<put_warmer()> method is used to create or update named warmers which
540 are used to I<warm up> new segments in the index before they are exposed
541 to user searches. For instance:
542  
543 $response = $e->indices->put_warmer(
544 index => 'my_index',
545 name => 'date_field_warmer',
546 body => {
547 sort => 'date'
548 }
549 );
550  
551 Query string parameters:
552 C<master_timeout>
553  
554 See the L<put_warmer docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-warmers.html>
555 for more information.
556  
557 =head2 C<get_warmer()>
558  
559 $response = $e->indices->get_warmer(
560 index => 'index' | \@indices, # optional
561 name => 'warmer' | \@warmers, # optional
562 );
563  
564 The C<get_warmer()> method is used to retrieve warmers by name.
565  
566 See the L<get_warmer docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-warmers.html>
567 for more information.
568  
569 =head2 C<delete_warmer()>
570  
571 $response = $e->indices->get_warmer(
572 index => 'index' | \@indices, # required
573 name => 'warmer' | \@warmers, # optional
574 );
575  
576 The C<delete_warmer()> method is used to delete warmers by name.
577  
578 Query string parameters:
579 C<master_timeout>
580  
581 See the L<delete_warmer docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-warmers.html>
582 for more information.
583  
584 =head1 STATS METHODS
585  
586 =head2 C<stats()>
587  
588 $result = $e->indices->stats(
589 index => 'index' | \@indices # optional
590 );
591  
592 The C<stats()> method returns statistical information about one, more or all
593 indices. Use the query string parameters to specify what information you
594 want returned.
595  
596 Query string parameters:
597 C<all>,
598 C<allow_no_indices>,
599 C<clear>,
600 C<completion>,
601 C<completion_fields>,
602 C<docs>,
603 C<expand_wildcards>,
604 C<fielddata>,
605 C<fielddata_fields>,
606 C<fields>,
607 C<filter_cache>,
608 C<flush>,
609 C<get>,
610 C<groups>,
611 C<id_cache>,
612 C<ignore_indices>,
613 C<ignore_unavailable>,
614 C<indexing>,
615 C<merge>,
616 C<refresh>,
617 C<search>,
618 C<store>,
619 C<warmer>
620  
621 See the L<stats docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-stats.html>
622 for more information.
623  
624 =head2 C<status()>
625  
626 $result = $e->indices->status(
627 index => 'index' | \@indices # optional
628 );
629  
630 Deprecated.
631  
632 Query string parameters:
633 C<allow_no_indices>,
634 C<expand_wildcards>,
635 C<ignore_indices>,
636 C<ignore_unavailable>,
637 C<recovery>,
638 C<snapshot>
639  
640 See the L<status docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-status.html>
641 for more information.
642  
643 =head2 C<segments()>
644  
645 $result = $e->indices->segments(
646 index => 'index' | \@indices # optional
647 );
648  
649 The C<segments()> method is used to return information about the segments
650 that an index contains.
651  
652 Query string parameters:
653 C<allow_no_indices>,
654 C<expand_wildcards>,
655 C<ignore_indices>,
656 C<ignore_unavailable>
657  
658 See the L<segments docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-segments.html>
659 for more information.
660  
661 =head1 QUERY AND ANALYSIS METHODS
662  
663 =head2 C<analyze()>
664  
665 $result = $e->indices->analyze(
666 index => 'index' # optional,
667 body => 'text to analyze'
668 );
669  
670 The C<analyze()> method passes the text in the C<body> through the specified
671 C<analyzer>, C<tokenizer> or token C<filter> - which may be global, or associated
672 with a particular index or field - and returns the tokens. Very useful
673 for debugging analyzer configurations.
674  
675 Query string parameters:
676 C<analyzer>,
677 C<field>,
678 C<filters>,
679 C<format>,
680 C<index>,
681 C<prefer_local>,
682 C<text>,
683 C<tokenizer>
684  
685 See the L<analyze docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-analyze.html>
686 for more information.
687  
688 =head2 C<validate_query()>
689  
690 $result = $e->indices->validate_query(
691 index => 'index' | \@indices, # optional
692 body => { query }
693 );
694  
695 The C<validate_query()> method accepts a query in the C<body> and checks
696 whether the query is valid or not. Most useful when C<explain> is set
697 to C<true>, in which case it includes an execution plan in the output.
698  
699 Query string parameters:
700 C<allow_no_indices>,
701 C<expand_wildcards>,
702 C<explain>,
703 C<ignore_indices>,
704 C<ignore_unavailable>,
705 C<q>,
706 C<source>
707  
708 See the L<validate_query docs|http://www.elastic.co/guide/en/elasticsearch/reference/0.90/indices-validate.html>
709 for more information.
710  
711 =head1 AUTHOR
712  
713 Enrico Zimuel <enrico.zimuel@elastic.co>
714  
715 =head1 COPYRIGHT AND LICENSE
716  
717 This software is Copyright (c) 2020 by Elasticsearch BV.
718  
719 This is free software, licensed under:
720  
721 The Apache License, Version 2.0, January 2004
722  
723 =cut
724  
725 __END__