lib/elasticsearch/api/actions/indices/analyze.rb in elasticsearch-api-1.0.6 vs lib/elasticsearch/api/actions/indices/analyze.rb in elasticsearch-api-1.0.7
- old
+ new
@@ -13,16 +13,18 @@
#
# client.indices.analyze text: 'The Quick Brown Jumping Fox', analyzer: 'snowball'
#
# @example Analyze text "Quick Brown Jumping Fox" with a custom tokenizer and filter chain
#
- # client.indices.analyze text: 'The Quick Brown Jumping Fox',
+ # client.indices.analyze body: 'The Quick Brown Jumping Fox',
# tokenizer: 'whitespace',
# filters: ['lowercase','stop']
#
+ # @note If your text for analysis is longer than 4096 bytes then you should use the :body argument, rather than :text, to avoid HTTP transport errors
+ #
# @option arguments [String] :index The name of the index to scope the operation
- # @option arguments [Hash] :body The text on which the analysis should be performed
+ # @option arguments [String] :body The text on which the analysis should be performed
# @option arguments [String] :analyzer The name of the analyzer to use
# @option arguments [String] :field Use the analyzer configured for this field
# (instead of passing the analyzer name)
# @option arguments [List] :filters A comma-separated list of filters to use for the analysis
# @option arguments [String] :index The name of the index to scope the operation
@@ -44,10 +46,10 @@
:prefer_local,
:text,
:tokenizer,
:format ]
- method = 'GET'
+ method = HTTP_GET
path = Utils.__pathify Utils.__listify(arguments[:index]), '_analyze'
params = Utils.__validate_and_extract_params arguments, valid_params
params[:filters] = Utils.__listify(params[:filters]) if params[:filters]