View source on GitHub |
Assigns a document score based on term frequency weighted by doc parts.
Inherits From: MatchScorer
, expected_type
google.appengine.api.search.RescoringMatchScorer()
If you add a RescoringMatchScorer to a SortOptions as in the following code:
sort_opts = search.SortOptions(match_scorer=search.RescoringMatchScorer())
then, this will sort the documents in descending score order. The scores will be positive. If you want to sort in ascending order, then use the following code:
sort_opts = search.SortOptions(match_scorer=search.RescoringMatchScorer(),
expressions=[search.SortExpression(
expression='_score', direction=search.SortExpression.ASCENDING,
default_value=0.0)])
The scores in this case will be negative.
Raises | |
---|---|
TypeError
|
If any of the parameters has an invalid type, or an unknown attribute is passed. |
ValueError
|
If any of the parameters has an invalid value. |