Class: CheapSkate::LukeResponse
- Inherits:
-
Object
- Object
- CheapSkate::LukeResponse
- Defined in:
- lib/cheap_skate/models.rb
Instance Attribute Summary collapse
-
#current ⇒ Object
Returns the value of attribute current.
-
#directory ⇒ Object
Returns the value of attribute directory.
-
#fields ⇒ Object
Returns the value of attribute fields.
-
#has_deletions ⇒ Object
Returns the value of attribute has_deletions.
-
#key ⇒ Object
Returns the value of attribute key.
-
#last_modified ⇒ Object
Returns the value of attribute last_modified.
-
#max_doc ⇒ Object
Returns the value of attribute max_doc.
-
#num_docs ⇒ Object
Returns the value of attribute num_docs.
-
#optimized ⇒ Object
Returns the value of attribute optimized.
-
#query_time ⇒ Object
Returns the value of attribute query_time.
-
#status ⇒ Object
Returns the value of attribute status.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
- #as_json ⇒ Object
- #as_ruby ⇒ Object
-
#initialize ⇒ LukeResponse
constructor
A new instance of LukeResponse.
- #to_hash ⇒ Object
Constructor Details
#initialize ⇒ LukeResponse
Returns a new instance of LukeResponse.
319 320 321 322 323 324 325 |
# File 'lib/cheap_skate/models.rb', line 319 def initialize @status = 0 @key = {"I"=>"Indexed", "T"=>"Tokenized", "S"=>"Stored", "M"=>"Multivalued", "V"=>"TermVector Stored", "o"=>"Store Offset With TermVector", "p"=>"Store Position With TermVector", "O"=>"Omit Norms", "L"=>"Lazy","B"=>"Binary","C"=>"Compressed","f"=>"Sort Missing First","l"=>"Sort Missing Last"} @fields = {} end |
Instance Attribute Details
#current ⇒ Object
Returns the value of attribute current.
317 318 319 |
# File 'lib/cheap_skate/models.rb', line 317 def current @current end |
#directory ⇒ Object
Returns the value of attribute directory.
317 318 319 |
# File 'lib/cheap_skate/models.rb', line 317 def directory @directory end |
#fields ⇒ Object
Returns the value of attribute fields.
317 318 319 |
# File 'lib/cheap_skate/models.rb', line 317 def fields @fields end |
#has_deletions ⇒ Object
Returns the value of attribute has_deletions.
317 318 319 |
# File 'lib/cheap_skate/models.rb', line 317 def has_deletions @has_deletions end |
#key ⇒ Object
Returns the value of attribute key.
317 318 319 |
# File 'lib/cheap_skate/models.rb', line 317 def key @key end |
#last_modified ⇒ Object
Returns the value of attribute last_modified.
317 318 319 |
# File 'lib/cheap_skate/models.rb', line 317 def last_modified @last_modified end |
#max_doc ⇒ Object
Returns the value of attribute max_doc.
317 318 319 |
# File 'lib/cheap_skate/models.rb', line 317 def max_doc @max_doc end |
#num_docs ⇒ Object
Returns the value of attribute num_docs.
317 318 319 |
# File 'lib/cheap_skate/models.rb', line 317 def num_docs @num_docs end |
#optimized ⇒ Object
Returns the value of attribute optimized.
317 318 319 |
# File 'lib/cheap_skate/models.rb', line 317 def optimized @optimized end |
#query_time ⇒ Object
Returns the value of attribute query_time.
317 318 319 |
# File 'lib/cheap_skate/models.rb', line 317 def query_time @query_time end |
#status ⇒ Object
Returns the value of attribute status.
317 318 319 |
# File 'lib/cheap_skate/models.rb', line 317 def status @status end |
#version ⇒ Object
Returns the value of attribute version.
317 318 319 |
# File 'lib/cheap_skate/models.rb', line 317 def version @version end |
Instance Method Details
#as_json ⇒ Object
335 336 337 |
# File 'lib/cheap_skate/models.rb', line 335 def as_json return to_hash.to_json end |
#as_ruby ⇒ Object
331 332 333 |
# File 'lib/cheap_skate/models.rb', line 331 def as_ruby return to_hash end |
#to_hash ⇒ Object
327 328 329 |
# File 'lib/cheap_skate/models.rb', line 327 def to_hash hsh = {"responseHeader"=>{"status" => @status, "QTime"=>@query_time}, "index"=>{"numDocs"=>@num_docs, "maxDoc"=>@max_doc, "version"=>@version, "optimized"=>@optimized, "current"=>@current, "hasDeletions"=>@has_deletions, "directory"=>@directory, "lastModified"=>@last_modified}, "fields"=>@fields, "key"=>@key} end |