![]() |
App Engine Python SDK
v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
|
Public Member Functions | |
def | __init__ |
def | doc_id |
def | fields |
def | language |
def | rank |
def | field |
def | __getitem__ |
def | __iter__ |
def | __repr__ |
def | __eq__ |
def | __ne__ |
def | __hash__ |
def | __str__ |
Public Attributes | |
doc_id | |
rank | |
language | |
fields | |
Represents a user generated document. The following example shows how to create a document consisting of a set of fields, some plain text and some in HTML. Document(doc_id='document_id', fields=[TextField(name='subject', value='going for dinner'), HtmlField(name='body', value='<html>I found a place.</html>', TextField(name='signature', value='brzydka pogoda', language='pl')], language='en')
def google.appengine.api.search.search.Document.__init__ | ( | self, | |
doc_id = None , |
|||
fields = None , |
|||
language = 'en' , |
|||
rank = None |
|||
) |
Initializer. Args: doc_id: The visible printable ASCII string identifying the document which does not start with '!'. Whitespace is excluded from ids. If no id is provided, the search service will provide one. fields: An iterable of Field instances representing the content of the document. language: The code of the language used in the field values. rank: The rank of this document used to specify the order in which documents are returned by search. Rank must be a non-negative integer. If not specified, the number of seconds since 1st Jan 2011 is used. Documents are returned in descending order of their rank, in absence of sorting or scoring options. Raises: TypeError: If any of the parameters have invalid types, or an unknown attribute is passed. ValueError: If any of the parameters have invalid values.
def google.appengine.api.search.search.Document.__getitem__ | ( | self, | |
field_name | |||
) |
Returns a list of all fields with the provided field name. Args: field_name: The name of the field to return. Returns: All fields with the given name, or an empty list if no field with that name exists.
def google.appengine.api.search.search.Document.__iter__ | ( | self | ) |
Documents do not support iteration. This is provided to raise an explicit exception.
def google.appengine.api.search.search.Document.doc_id | ( | self | ) |
Returns the document identifier.
def google.appengine.api.search.search.Document.field | ( | self, | |
field_name | |||
) |
Returns the field with the provided field name. Args: field_name: The name of the field to return. Returns: A field with the given name. Raises: ValueError: There is not exactly one field with the given name.
def google.appengine.api.search.search.Document.fields | ( | self | ) |
Returns a list of fields of the document.
def google.appengine.api.search.search.Document.language | ( | self | ) |
Returns the code of the language the document fields are written in.
def google.appengine.api.search.search.Document.rank | ( | self | ) |
Returns the rank of this document.