.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Search::Elasticsearch::Transport 3pm" .TH Search::Elasticsearch::Transport 3pm "2018-05-17" "perl v5.26.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Search::Elasticsearch::Transport \- Provides interface between the client class and the Elasticsearch cluster .SH "VERSION" .IX Header "VERSION" version 6.00 .SH "DESCRIPTION" .IX Header "DESCRIPTION" The Transport class manages the request cycle. It receives parsed requests from the (user-facing) client class, and tries to execute the request on a node in the cluster, retrying a request if necessary. .PP This class does Search::Elasticsearch::Role::Transport and Search::Elasticsearch::Role::Is_Sync. .SH "CONFIGURATION" .IX Header "CONFIGURATION" .ie n .SS """send_get_body_as""" .el .SS "\f(CWsend_get_body_as\fP" .IX Subsection "send_get_body_as" .Vb 3 \& $e = Search::Elasticsearch\->new( \& send_get_body_as => \*(AqPOST\*(Aq \& ); .Ve .PP Certain endpoints like \*(L"\fIsearch()\fR\*(R" in Search::Elasticsearch::Client::6_0::Direct default to using a \f(CW\*(C`GET\*(C'\fR method, even when they include a request body. Some proxy servers do not support \f(CW\*(C`GET\*(C'\fR requests with a body. To work around this, the \f(CW\*(C`send_get_body_as\*(C'\fR parameter accepts the following: .IP "\(bu" 4 \&\f(CW\*(C`GET\*(C'\fR .Sp The default. Request bodies are sent as \f(CW\*(C`GET\*(C'\fR requests. .IP "\(bu" 4 \&\f(CW\*(C`POST\*(C'\fR .Sp The method is changed to \f(CW\*(C`POST\*(C'\fR when a body is present. .IP "\(bu" 4 \&\f(CW\*(C`source\*(C'\fR .Sp The body is encoded as \s-1JSON\s0 and added to the query string as the \f(CW\*(C`source\*(C'\fR parameter. This has the advantage of still being a \f(CW\*(C`GET\*(C'\fR request (for those filtering on request method) but has the disadvantage of being restricted in size. The limit depends on the proxies between the client and Elasticsearch, but usually is around 4kB. .SH "METHODS" .IX Header "METHODS" .ie n .SS """perform_request()""" .el .SS "\f(CWperform_request()\fP" .IX Subsection "perform_request()" Raw requests can be executed using the transport class as follows: .PP .Vb 12 \& $result = $e\->transport\->perform_request( \& method => \*(AqPOST\*(Aq, \& path => \*(Aq/_search\*(Aq, \& qs => { from => 0, size => 10 }, \& body => { \& query => { \& match => { \& title => "Elasticsearch clients" \& } \& } \& } \& ); .Ve .PP Other than the \f(CW\*(C`method\*(C'\fR, \f(CW\*(C`path\*(C'\fR, \f(CW\*(C`qs\*(C'\fR and \f(CW\*(C`body\*(C'\fR parameters, which should be self-explanatory, it also accepts: .ie n .IP """ignore""" 4 .el .IP "\f(CWignore\fR" 4 .IX Item "ignore" The \s-1HTTP\s0 error codes which should be ignored instead of throwing an error, eg \f(CW\*(C`404 NOT FOUND\*(C'\fR: .Sp .Vb 5 \& $result = $e\->transport\->perform_request( \& method => \*(AqGET\*(Aq, \& path => \*(Aq/index/type/id\*(Aq \& ignore => [404], \& ); .Ve .ie n .IP """serialize""" 4 .el .IP "\f(CWserialize\fR" 4 .IX Item "serialize" Whether the \f(CW\*(C`body\*(C'\fR should be serialized in the standard way (as plain \&\s-1JSON\s0) or using the special \fIbulk\fR format: \f(CW"std"\fR or \f(CW"bulk"\fR. .SH "AUTHOR" .IX Header "AUTHOR" Clinton Gormley .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is Copyright (c) 2017 by Elasticsearch \s-1BV.\s0 .PP This is free software, licensed under: .PP .Vb 1 \& The Apache License, Version 2.0, January 2004 .Ve