Sha256: 64110b1a72d7136c8fbc2e327fc831369c70f12cbe8f464460c1246636bfc4f3

Contents?: true

Size: 1.9 KB

Versions: 69

Compression:

Stored size: 1.9 KB

Contents

module Elasticsearch
  module API
    module Actions

      # Return query terms suggestions based on provided text and configuration.
      #
      # Pass the request definition in the `:body` argument.
      #
      # @example Return query terms suggestions ("auto-correction")
      #
      #     client.suggest index: 'myindex',
      #                    body: { my_suggest: { text: 'tset', term: { field: 'title' } } }
      #     # => { ... "my_suggest"=>[ {"text"=>"tset", ... "options"=>[{"text"=>"test", "score"=>0.75, "freq"=>5}] }]}
      #
      # @option arguments [List] :index A comma-separated list of index names to restrict the operation;
      #                                 use `_all` or empty string to perform the operation on all indices
      # @option arguments [Hash] :body The request definition
      # @option arguments [String] :ignore_indices When performed on multiple indices, allows to ignore `missing` ones
      #                                            (options: none, missing)
      # @option arguments [String] :preference Specify the node or shard the operation should be performed on
      #                                        (default: random)
      # @option arguments [String] :routing Specific routing value
      # @option arguments [String] :source The URL-encoded request definition (instead of using request body)
      #
      # @since 0.90
      #
      # @see http://elasticsearch.org/guide/reference/api/search/suggest/
      #
      def suggest(arguments={})
        valid_params = [
          :ignore_indices,
          :preference,
          :routing,
          :source ]

        method = HTTP_POST
        path   = Utils.__pathify( Utils.__listify(arguments[:index]), '_suggest' )

        params = Utils.__validate_and_extract_params arguments, valid_params
        body   = arguments[:body]

        perform_request(method, path, params, body).body
      end
    end
  end
end

Version data entries

69 entries across 69 versions & 6 rubygems

Version Path
logstash-output-scalyr-0.2.1.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/suggest.rb
logstash-output-scalyr-0.2.0 vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/suggest.rb
logstash-output-scalyr-0.2.0.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/suggest.rb
logstash-output-scalyr-0.1.26.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/suggest.rb
logstash-output-scalyr-0.1.25.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/suggest.rb
logstash-output-scalyr-0.1.24.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/suggest.rb
logstash-output-scalyr-0.1.23.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/suggest.rb
logstash-output-scalyr-0.1.22.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/suggest.rb
logstash-output-scalyr-0.1.21.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/suggest.rb
logstash-output-scalyr-0.1.20.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/suggest.rb
logstash-output-scalyr-0.1.19.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/suggest.rb
logstash-output-scalyr-0.1.18.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/suggest.rb
logstash-output-scalyr-0.1.17.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/suggest.rb
logstash-output-scalyr-0.1.16.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/suggest.rb
logstash-output-scalyr-0.1.15.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/suggest.rb
logstash-output-scalyr-0.1.14.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/suggest.rb
logstash-output-scalyr-0.1.13 vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/suggest.rb
logstash-output-scalyr-0.1.12 vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/suggest.rb
logstash-output-scalyr-0.1.11.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/suggest.rb
logstash-output-scalyr-0.1.10.beta vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/suggest.rb