App Engine Python SDK  v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
Public Member Functions | List of all members
google.appengine.api.search.search.MatchScorer Class Reference
Inheritance diagram for google.appengine.api.search.search.MatchScorer:
google.appengine.api.search.search.RescoringMatchScorer

Public Member Functions

def __init__
 
def __repr__
 

Detailed Description

Assigns a document score based on term frequency.

If you add a MatchScorer to a SortOptions as in the following code:

    sort_opts = search.SortOptions(match_scorer=search.MatchScorer())

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.MatchScorer(),
        expressions=[search.SortExpression(
            expression='_score', direction=search.SortExpression.ASCENDING,
            default_value=0.0)])

The scores in this case will be negative.

Constructor & Destructor Documentation

def google.appengine.api.search.search.MatchScorer.__init__ (   self)
Initializer.

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.

The documentation for this class was generated from the following file: