A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://cloud.google.com/appengine/docs/legacy/standard/python/search/fieldclasses below:

Field Classes | App Engine standard environment for Python 2

Field Classes

Stay organized with collections Save and categorize content based on your preferences.

Class Field is an abstract base class representing a field of a document. This class should not be directly instantiated; instead, use one of the subclasses representing specific data types.

This API is supported for first-generation runtimes and can be used when upgrading to corresponding second-generation runtimes. If you are updating to the App Engine Python 3 runtime, refer to the migration guide to learn about your migration options for legacy bundled services.

Field is defined in the module google.appengine.api.search.

Properties

An instance of class Field has the following properties:

name

Name of the field. Must begin with a letter, contain only letters, digits, and underscores (_), and be no longer than 500 characters.

language

Two-letter ISO 693-1 language code for the field's content, to assist in tokenization. For example, en signifies that the field is English. If None, the language code of the document will be used.

value

Value of the field. Data type varies depending on the specific subclass.

Subclasses

Class Field has the following subclasses:

class TextField

A field containing text.

The field's value must be a string or Unicode string. The following example shows a text field named signature with Polish language content:

TextField(name='signature', value='brzydka pogoda', language='pl')

Exceptions

TypeError

Value supplied is not a text string.

ValueError

Value exceeds maximum allowable length.

class HtmlField

A field containing HTML content.

The field's value must be a string or Unicode string containing the searchable content of the field. The following example shows an HTML field named content:

HtmlField(name='content', value='<html>herbata, kawa</html>', language='pl')

Exceptions

TypeError

Value supplied is not a text string.

ValueError

Value exceeds maximum allowable length.

class AtomField

A field containing text to be treated as an indivisible (atomic) token for indexing purposes.

The field's value must be a string or Unicode object to be treated as an atomic token. The following example shows an atom field named contributor:

AtomField(name='contributor', value='foo@bar.com')

Exceptions

TypeError

Value supplied is not a text string.

ValueError

Value exceeds maximum allowable length.

class NumberField

A field containing a numeric value.

The field's value must be numeric. The following example shows a number field named size with integer value 10:

NumberField(name='size', value=10)

Exception

TypeError

Value supplied is not numeric.

class DateField

A field containing a date or datetime value.

The field's value must be of type datetime.date, or datetime.datetime. Only Python "naive" date and time objects can be used. "Aware" objects are not allowed. The following example shows a date field named creation_date representing the date 21 March 2011:

DateField(name='creation_date', value=datetime.date(2011, 03, 21))

Exception

TypeError

Value supplied is not a datetime.date or a datetime.datetime.

class GeoField

A field containing a GeoPoint value.

The following example shows a GeoField named place representing a location at -33.84 degrees latitude and 151.26 degrees longitude:

GeoField(name='place', value=GeoPoint(latitude=-33.84, longitude=151.26))

Exception

TypeError

Value supplied is not a GeoPoint.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-07 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["The `Field` class is an abstract base class for document fields and should not be directly instantiated; subclasses should be used instead."],["Each `Field` instance has properties for `name`, `language`, and `value`, with specific constraints on the `name` format and the `value` data type."],["There are six subclasses of `Field`: `TextField`, `HtmlField`, `AtomField`, `NumberField`, `DateField`, and `GeoField`, each designed for different data types like text, HTML, atomic tokens, numbers, dates, and geographic locations, respectively."],["Each subclass of `Field` has specific data type requirements for the `value` property and will raise a `TypeError` if an incorrect type is provided."],["The different subclasses will raise `ValueError` exceptions if the `value` exceeds the maximum allowable length."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4