Class: Ferret::Search::MatchAllDocsQuery

Inherits:
Query
  • Object
show all
Defined in:
lib/ferret/search/match_all_docs_query.rb

Overview

A query that matches all documents.

Defined Under Namespace

Classes: MatchAllDocsWeight, MatchAllScorer

Instance Attribute Summary

Attributes inherited from Query

#boost

Instance Method Summary collapse

Methods inherited from Query

#combine, #extract_terms, #merge_boolean_queries, #rewrite, #similarity, #weight

Constructor Details

#initializeMatchAllDocsQuery

Returns a new instance of MatchAllDocsQuery.



5
6
7
# File 'lib/ferret/search/match_all_docs_query.rb', line 5

def initialize() 
  super
end

Instance Method Details

#create_weight(searcher) ⇒ Object



85
86
87
# File 'lib/ferret/search/match_all_docs_query.rb', line 85

def create_weight(searcher) 
  return MatchAllDocsWeight.new(self, searcher)
end

#eql?(o) ⇒ Boolean Also known as: ==

Returns:

  • (Boolean)


95
96
97
# File 'lib/ferret/search/match_all_docs_query.rb', line 95

def eql?(o) 
  return (o.instance_of?(MatchAllDocsQuery) and boost == o.boost)
end

#hashObject



100
101
102
# File 'lib/ferret/search/match_all_docs_query.rb', line 100

def hash
  return boost.hash
end

#to_s(field) ⇒ Object



89
90
91
92
93
# File 'lib/ferret/search/match_all_docs_query.rb', line 89

def to_s(field) 
  buffer = "MatchAllDocsQuery"
  buffer << "^#{boost}" if (boost() != 1.0) 
  return buffer
end