ScoredDocument represents a scored document returned from a search. You do not build this class explicitly; rather, it is returned as a result of
ScoredDocument is defined in the
The constructor for class
MatchScorer is defined as follows:
- class ScoredDocument(doc_id=None, fields=None, language='en', sort_scores=None, expressions=None, cursor=None, rank=None)
Represents a scored document returned from a search.
The visible, printable ASCII string identifying the document. Must not begin with '!'. Whitespace is excluded from ids. If no id is provided, the search service will provide one.
An iterable of Field instances representing the content of the document.
The two-letter ISO 639.2 language code of the language used in the field values.
The list of scores assigned during sort evaluation. Each sort dimension is included. Positive scores are used for ascending sorts; negative scores for descending.
The list of computed fields which are the result of expressions requested.
A cursor associated with the document.
The document rank is used to specify the order this document will be returned in search results, where 0 <= rank <= sys.maxint. If not specified, the number of seconds since 1st Jan 2011 is used. Documents are returned in descending order of the order ID.
A new instance of class
If any of the parameters have an invalid type, or an unknown attribute is passed.
If any parameter has an invalid value.
An instance of class
ScoredDocument has the following properties:
Returns the list of scores assigned while the API is sorting the results of a search. Each sort dimension is included. Positive scores are used for ascending sorts and negative scores for descending.
The list of computed fields the result of expression evaluation. For example, the following field expression seeks to compute a snippet field containing HTML snippets extracted from the matching of the query
'good story'in the
FieldExpression(name='snippet', 'snippet("good story", content)')Given this query, the API would return the following
HtmlField(name='snippet', value='that was a good story to finish')
A cursor associated with a result used as a starting point from which to return the next set of search results. This property will not return unless you set the
Index.RESULT_CURSOR; otherwise the property returns be