Class: Ferret::Search::StringFieldComparator
Constant Summary
Ferret::Search::ScoreDocComparator::INDEX_ORDER, Ferret::Search::ScoreDocComparator::RELEVANCE
Instance Method Summary
collapse
Constructor Details
Returns a new instance of StringFieldComparator.
99
100
101
102
|
# File 'lib/ferret/search/score_doc_comparator.rb', line 99
def initialize(index)
@str_index = index.str_index
@str_map = index.str_map
end
|
Instance Method Details
#compare(i, j) ⇒ Object
104
105
106
|
# File 'lib/ferret/search/score_doc_comparator.rb', line 104
def compare(i, j)
return @str_index[i.doc] <=> @str_index[j.doc]
end
|
#sort_type ⇒ Object
110
111
112
|
# File 'lib/ferret/search/score_doc_comparator.rb', line 110
def sort_type()
return SortField::SortType::STRING
end
|
#sort_value(i) ⇒ Object
107
108
109
|
# File 'lib/ferret/search/score_doc_comparator.rb', line 107
def sort_value(i)
return @str_map[@str_index[i.doc]]
end
|