GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  SEARCH::ELASTICSEARCH::TRANSPORT (3)

.ds Aq ’

NAME

Search::Elasticsearch::Transport - Provides interface between the client class and the Elasticsearch cluster

CONTENTS

VERSION

version 2.00

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.

This class does Search::Elasticsearch::Role::Transport and Search::Elasticsearch::Role::Is_Sync.

CONFIGURATION

CWsend_get_body_as



    $e = Search::Elasticsearch->new(
        send_get_body_as => POST
    );



Certain endpoints like search() in Search::Elasticsearch::Client::2_0::Direct default to using a GET method, even when they include a request body. Some proxy servers do not support GET requests with a body. To work around this, the send_get_body_as parameter accepts the following:
o GET

The default. Request bodies are sent as GET requests.

o POST

The method is changed to POST when a body is present.

o source

The body is encoded as JSON and added to the query string as the source parameter. This has the advantage of still being a GET 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.

METHODS

CWperform_request()

Raw requests can be executed using the transport class as follows:



    $result = $e->transport->perform_request(
        method => POST,
        path   => /_search,
        qs     => { from => 0, size => 10 },
        body   => {
            query => {
                match => {
                    title => "Elasticsearch clients"
                }
            }
        }
    );



Other than the method, path, qs and body parameters, which should be self-explanatory, it also accepts:
ignore The HTTP error codes which should be ignored instead of throwing an error, eg 404 NOT FOUND:



    $result = $e->transport->perform_request(
        method => GET,
        path   => /index/type/id
        ignore => [404],
    );



serialize Whether the body should be serialized in the standard way (as plain JSON) or using the special bulk format: "std" or "bulk".

AUTHOR

Clinton Gormley <drtech@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2015 by Elasticsearch BV.

This is free software, licensed under:



  The Apache License, Version 2.0, January 2004



Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 SEARCH::ELASTICSEARCH::TRANSPORT (3) 2015-10-28

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.