123456789_123456789_123456789_123456789_123456789_

Class: Mongoid::SearchIndexable::Status Private

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: lib/mongoid/search_indexable.rb

Overview

Represents the status of the indexes returned by a search_indexes call.

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#indexesArray<Hash> (readonly)

Returns:

[ GitHub ]

  
# File 'lib/mongoid/search_indexable.rb', line 15

attr_reader :indexes

#readyArray<Hash> (readonly)

Returns the subset of indexes that have status == ‘READY’

Returns:

  • (Array<Hash>)

    index documents for “ready” indices

[ GitHub ]

  
# File 'lib/mongoid/search_indexable.rb', line 27

def ready
  indexes.select { |i| i['status'] == 'READY' }
end

#ready?true | false (readonly)

Returns true if all the given indexes are ‘ready’ and ‘queryable’.

Returns:

  • (true | false)

    ready status of all indexes

[ GitHub ]

  
# File 'lib/mongoid/search_indexable.rb', line 48

def ready?
  indexes.all? { |i| i['status'] == 'READY' && i['queryable'] }
end

Instance Method Details

#pendingArray<Hash>

Returns the subset of indexes that have status == ‘PENDING’

Returns:

  • (Array<Hash>)

    index documents for “pending” indices

[ GitHub ]

  
# File 'lib/mongoid/search_indexable.rb', line 34

def pending
  indexes.select { |i| i['status'] == 'PENDING' }
end

#queryableArray<Hash>

Returns the subset of indexes that are marked ‘queryable’

Returns:

  • (Array<Hash>)

    index documents for ‘queryable’ indices

[ GitHub ]

  
# File 'lib/mongoid/search_indexable.rb', line 41

def queryable
  indexes.select { |i| i['queryable'] }
end