Class: Elasticsearch::Autocomplete::SingleRequest
- Defined in:
- lib/elasticsearch/autocomplete/single_request.rb
Instance Attribute Summary collapse
-
#field ⇒ Object
Returns the value of attribute field.
Attributes inherited from Request
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(index, query, types, field) ⇒ SingleRequest
constructor
A new instance of SingleRequest.
Constructor Details
#initialize(index, query, types, field) ⇒ SingleRequest
Returns a new instance of SingleRequest.
19 20 21 22 |
# File 'lib/elasticsearch/autocomplete/single_request.rb', line 19 def initialize(index, query, types, field) super(index, query, types) self.field = field end |
Instance Attribute Details
#field ⇒ Object
Returns the value of attribute field.
17 18 19 |
# File 'lib/elasticsearch/autocomplete/single_request.rb', line 17 def field @field end |
Instance Method Details
#body ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/elasticsearch/autocomplete/single_request.rb', line 24 def body @body ||= begin { :index => index, :type => types.map(&:type).uniq, :body => { :query => Type.single_search(query, field) } } end end |