Class: CheapSkate::LukeResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/cheap_skate/models.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLukeResponse

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

#currentObject

Returns the value of attribute current.



317
318
319
# File 'lib/cheap_skate/models.rb', line 317

def current
  @current
end

#directoryObject

Returns the value of attribute directory.



317
318
319
# File 'lib/cheap_skate/models.rb', line 317

def directory
  @directory
end

#fieldsObject

Returns the value of attribute fields.



317
318
319
# File 'lib/cheap_skate/models.rb', line 317

def fields
  @fields
end

#has_deletionsObject

Returns the value of attribute has_deletions.



317
318
319
# File 'lib/cheap_skate/models.rb', line 317

def has_deletions
  @has_deletions
end

#keyObject

Returns the value of attribute key.



317
318
319
# File 'lib/cheap_skate/models.rb', line 317

def key
  @key
end

#last_modifiedObject

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_docObject

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_docsObject

Returns the value of attribute num_docs.



317
318
319
# File 'lib/cheap_skate/models.rb', line 317

def num_docs
  @num_docs
end

#optimizedObject

Returns the value of attribute optimized.



317
318
319
# File 'lib/cheap_skate/models.rb', line 317

def optimized
  @optimized
end

#query_timeObject

Returns the value of attribute query_time.



317
318
319
# File 'lib/cheap_skate/models.rb', line 317

def query_time
  @query_time
end

#statusObject

Returns the value of attribute status.



317
318
319
# File 'lib/cheap_skate/models.rb', line 317

def status
  @status
end

#versionObject

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_jsonObject



335
336
337
# File 'lib/cheap_skate/models.rb', line 335

def as_json
  return to_hash.to_json
end

#as_rubyObject



331
332
333
# File 'lib/cheap_skate/models.rb', line 331

def as_ruby
  return to_hash
end

#to_hashObject



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