Class: Redis::Commands::Search::SearchResult
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Instance Chain:
self,
Enumerable
|
|
| Inherits: | Object |
| Defined in: | lib/redis/commands/modules/search/result.rb |
Overview
Result of FT.SEARCH: the total number of matching documents (which may exceed the number returned because of paging) plus the documents on this page.
Class Method Summary
Instance Attribute Summary
- #documents ⇒ Integer, ... readonly
- #empty? ⇒ Boolean readonly
- #total ⇒ Integer, ... readonly
- #warnings ⇒ Integer, ... readonly
Instance Method Summary
- #[](index) ⇒ Document?
-
#each {|document| ... } ⇒ Enumerator, Array<Document>
Iterate over the documents on this page.
-
#length
Alias for #size.
- #size ⇒ Integer (also: #length)
Constructor Details
.new(total, documents, warnings: []) ⇒ SearchResult
Instance Attribute Details
#documents ⇒ Integer, ... (readonly)
#empty? ⇒ Boolean (readonly)
# File 'lib/redis/commands/modules/search/result.rb', line 112
def empty? @documents.empty? end
#total ⇒ Integer, ... (readonly)
#warnings ⇒ Integer, ... (readonly)
Instance Method Details
#[](index) ⇒ Document?
# File 'lib/redis/commands/modules/search/result.rb', line 101
def [](index) @documents[index] end
#each {|document| ... } ⇒ Enumerator, Array<Document>
Iterate over the documents on this page.
# File 'lib/redis/commands/modules/search/result.rb', line 95
def each(&block) @documents.each(&block) end
#length
Alias for #size.
# File 'lib/redis/commands/modules/search/result.rb', line 109
alias length size
#size ⇒ Integer
Also known as: #length
# File 'lib/redis/commands/modules/search/result.rb', line 106
def size @documents.size end