0_90/Direct/Indices.pm untested

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