Class: Velocity::Instance::SearchCollection::Status

Inherits:
Object
  • Object
show all
Defined in:
lib/acceleration/velocity.rb

Overview

This models the collection status XML returned by Velocity.

Defined Under Namespace

Classes: CrawlerStatus, IndexerStatus, ServiceStatus

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(doc) ⇒ Status

Create a new wrapper for the status XML



761
762
763
# File 'lib/acceleration/velocity.rb', line 761

def initialize(doc)
  @doc = doc
end

Instance Attribute Details

#docObject

The raw document describing the status



756
757
758
# File 'lib/acceleration/velocity.rb', line 756

def doc
  @doc
end

Instance Method Details

#crawlerObject

Get the crawler status node



768
769
770
# File 'lib/acceleration/velocity.rb', line 768

def crawler
  CrawlerStatus.new doc.xpath('/vse-status/crawler-status').first
end

#has_data?Boolean

Check to see if the collection actually has a status.

If false, then the collection isn’t running and has no data. if true, then the collection may be running but certainly has data.

Returns:

  • (Boolean)


784
785
786
# File 'lib/acceleration/velocity.rb', line 784

def has_data?
  doc.xpath('__CONTAINER__').empty?
end

#indexerObject

Get the indexer status node



775
776
777
# File 'lib/acceleration/velocity.rb', line 775

def indexer
  IndexerStatus.new doc.xpath('/vse-status/vse-index-status').first
end