Class: Ferret::Search::SimpleFieldComparator
Constant Summary
Ferret::Search::ScoreDocComparator::INDEX_ORDER, Ferret::Search::ScoreDocComparator::RELEVANCE
Instance Method Summary
collapse
Constructor Details
Returns a new instance of SimpleFieldComparator.
72
73
74
75
|
# File 'lib/ferret/search/score_doc_comparator.rb', line 72
def initialize(index, sort_type)
@index = index
@sort_type = sort_type
end
|
Instance Method Details
#compare(j, i) ⇒ Object
77
78
79
|
# File 'lib/ferret/search/score_doc_comparator.rb', line 77
def compare(j, i)
return @index[i.doc] <=> @index[j.doc]
end
|
#sort_type ⇒ Object
83
84
85
|
# File 'lib/ferret/search/score_doc_comparator.rb', line 83
def sort_type()
return @sort_type
end
|
#sort_value(i) ⇒ Object
80
81
82
|
# File 'lib/ferret/search/score_doc_comparator.rb', line 80
def sort_value(i)
return @index[i.doc]
end
|