nitc :: IndexMatch
Each match has a score
. The score should be seen as the distance of
the match from the query. In other words, the lowest is the score, the more
relevant is the match.
nitc $ IndexMatch :: SELF
Type of this instance, automatically specialized in every classcore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: IndexMatch :: defaultinit
core :: Object :: defaultinit
core :: Comparable :: defaultinit
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).
# An MEntity matched from a ModelIndex
#
# Each match has a `score`. The score should be seen as the distance of
# the match from the query. In other words, the lowest is the score, the more
# relevant is the match.
class IndexMatch
super Comparable
redef type OTHER: IndexMatch
# MEntity matches
var mentity: MEntity
# Score allocated by the search method
#
# A lowest score means a more relevant match.
#
# Scores values are arbitrary, the meaning of `10` vs `2000` really depends
# on the search method producing the match and the comparators used to sort
# the matches.
# The only universal rule is: low score = relevance.
var score: Int is writable
# By default matches are compared only on their score
redef fun <=>(o) do return score <=> o.score
redef fun to_s do return "{mentity} ({score})"
end
src/model/model_index.nit:522,1--549,3