Skip to content

Commit

Permalink
spellcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
gugod committed Apr 29, 2016
1 parent 2545dbd commit 6bcb7f1
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions lib/Elastijk.pm
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ __END__
=head1 NAME
Elastijk - A specialized ElasticSearch client.
Elastijk - A specialized Elasticsearch client.
=head1 SYNOPSIS
Expand Down Expand Up @@ -86,8 +86,8 @@ Elastijk - A specialized ElasticSearch client.
=head1 DESCRIPTION
Elastijk isn a ElasticSearch client library. It uses L<Hijk>, a HTTP client that
implements a tiny subset of HTTP/1.1 just enough to talk to ElasticSearch via
Elastijk is a Elasticsearch client library. It uses L<Hijk>, a HTTP client that
implements a tiny subset of HTTP/1.1 just enough to talk to Elasticsearch via
HTTP.
Elastijk provided low-level functions that are almost identical as using HTTP
Expand All @@ -98,9 +98,9 @@ use. The following documentation describe the low-level function first.
=head2 Elastijk::request( $args :HashRef ) : ($status :Int, $response :HashRef)
Making a request to the ElasticSearch server specified in C<$args>. It returns 2
Making a request to the Elasticsearch server specified in C<$args>. It returns 2
values. C<$status> is the HTTP status code of the response, and the C<$response>
decoded as HashRef. ElasticSearch API always respond a single HashRef as JSON
decoded as HashRef. Elasticsearch API always respond a single HashRef as JSON
text, this might or might not be changed in the future, if it is changed then
this function will be adjusted accordingly.
Expand All @@ -117,7 +117,7 @@ The C<$args> is a HashRef takes contains the following key-value pairs:
method => "GET" | "POST" | "HEAD" | "PUT" | "DELETE"
The 4 values of C<index>, C<type>, C<id>, C<command> are used to form the URI
path following ElasticSearch's routing convention:
path following Elasticsearch's routing convention:
/${index}/${type}/${id}/${command}
Expand All @@ -128,20 +128,20 @@ remove C</> in between to form the URL that makes sense, for example:
/${index}/${command}
The value of C<uri_param> is used to form the query_string part in the URI, some
common ones for ElasticSearch are C<q>, C<search_type>, and C<timeout>. But the
common ones for Elasticsearch are C<q>, C<search_type>, and C<timeout>. But the
accepted list is different for different commands.
The value of C<method> corresponds to HTTP verbs, and is hard-coded to match
ElasticSearch API. Users generally do not need to provide this value, unless you
Elasticsearch API. Users generally do not need to provide this value, unless you
are calling C<request> directly, in which case, the default value is 'GET'.
For all cases, Elastijk simply bypass the value it recieve to the server without
For all cases, Elastijk simply bypass the value it receive to the server without
doing any parameter validation. If that generates some errors, it'll be on
server side.
=head2 Elastijk::request_raw( $args :HashRef ) : ($status :Int, $response :Str)
Making a request to the ElasticSearch server specified in C<$args>. The main
Making a request to the Elasticsearch server specified in C<$args>. The main
difference between this function and C<Elastijk::request> is that
C<$args->{body}> s expected to be a String scalar, rather then a HashRef. And
the $response is not decoded from JSON. This function can be used if users wish
Expand All @@ -160,7 +160,7 @@ An Elastijk object is constructed like this:
);
Under the hood, it is only a blessed hash, while all key-value pairs in the hash
are the properties. Users could break the pacaking and modify those values, but
are the properties. Users could break the packaging and modify those values, but
it is fine. All key-value pairs are shallow-copied from `new` method.
Here's a full list of key-value pairs that are consumed:
Expand All @@ -177,21 +177,21 @@ Given objects constructed with different default of C<index> attribute:
$es0 = Elastijk->new();
$es1 = Elastijk->new( index => "foo" );
... calling the same C<search> method with the same arugments will generate
... calling the same C<search> method with the same arguments will generate
different request:
my @args = (uri_param => { q => "nihao" });
$es0->search( @args ); # GET /_search?q=nihao
$es1->search( @args ); # GET /foo/_search?q=nihao
This behaviour is consistent for all methods.
This behavior is consistent for all methods.
=head1 METHODS
All methods takes the same key-value pair HashRef as C<Elastijk::request> function,
and returns 2 values that are HTTP status code, and the body hashref.
Many of of methods are named after an server command. For eaxmple, the command
Many of of methods are named after an server command. For example, the command
C<_search> corresponds to method C<search>, the command C<_bulk> corresponds to
method C<bulk>.
Expand All @@ -205,7 +205,7 @@ All methods return 2 values that are HTTP status code, and the body hashref:
...
}
The status code is used for error-checking purposes. ElastiSearch should respond
The status code is used for error-checking purposes. Elasticsearch should respond
with status 4XX when the relevant thing is missing, and 5XX when there are some
sort of errors. To check if a request is successful, test if it is 200 or 201.
Expand All @@ -228,7 +228,7 @@ HashRef) to allow these intuitive use cases:
=head2 request( ... )
This is a low-level method that just bypass things, but it is useful when, say,
newer ElasticSearch versoin introduce a new command, and there are no
newer Elasticsearch version introduce a new command, and there are no
corresponding method in the Client yet. The only difference between using this
method and calling C<Elasijk::request> directly, is that the values of
C<host>,C<port>,C<index>, and <type> ind the object context are consumed.
Expand Down Expand Up @@ -297,7 +297,7 @@ body hash just like other methods.
=head1 COPYRIGHT
Copyright (c) 2013,2014 Kang-min Liu C<< <gugod@gugod.org> >>.
Copyright (c) 2013-2016 Kang-min Liu C<< <gugod@gugod.org> >>.
=head1 LICENCE
Expand Down

0 comments on commit 6bcb7f1

Please sign in to comment.