[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[[["\u003cp\u003eThe \u003ccode\u003eFacet\u003c/code\u003e class is an abstract base class for representing document facets and should not be directly instantiated.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eFacet\u003c/code\u003e objects have properties for a \u003ccode\u003ename\u003c/code\u003e, which must follow a specific format and length restriction, and a \u003ccode\u003evalue\u003c/code\u003e, which can be a string, unicode, or number.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eAtomFacet\u003c/code\u003e is a subclass of \u003ccode\u003eFacet\u003c/code\u003e where the value is treated as a single text token, and errors are raised if the value is not a text string or exceeds the maximum length.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eNumberFacet\u003c/code\u003e is another subclass of \u003ccode\u003eFacet\u003c/code\u003e where the value is numeric, with errors raised if a non-numeric value is provided or if the value is out of range.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eFacet\u003c/code\u003e API is supported for first-generation runtimes and has considerations when upgrading to the second-generation App Engine Python 3 runtime, outlined in a migration guide.\u003c/p\u003e\n"]]],[],null,["# Facet Classes\n\nClass `Facet` is an abstract base class representing a facet of a document. This class should not be directly instantiated.\n| This API is supported for first-generation runtimes and can be used when [upgrading to corresponding second-generation runtimes](/appengine/docs/standard/\n| python3\n|\n| /services/access). If you are updating to the App Engine Python 3 runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/python-differences) to learn about your migration options for legacy bundled services.\n\n`Facet` is defined in the module `google.appengine.api.search`.\n\nProperties\n----------\n\nAn instance of class `Facet` has the following properties:\n\nname\n\n: The name of the facet. Facet\n names must have maximum length MAXIMUM_FIELD_NAME_LENGTH and match pattern \"\\[A-Za-z\\]\\[A-Za-\n z0-9_\\]\\*\".\n\nvalue\n\n: The value of the facet which can be a str, unicode or number.\n\nSubclasses\n----------\n\nClass `Facet` has the following subclasses:\n\n\nclass AtomFacet\n\n: A Facet that has content to be treated as a single token for indexing.\n\n The facet's value is a str or unicode object to be treated as an indivisible text value. The following example shows an atom facet named wine_type: \n\n ```\n AtomFacet(name='wine_type', value='Red')\n ```\n\n: Exceptions\n\n TypeError\n\n : Value supplied is not a text string.\n\n ValueError\n\n : Value exceeds maximum allowable length.\n\n\nclass NumberFacet\n\n: A Facet that has a numeric value.\n\n The following example shows a number facet named wine_vintage: \n\n ```\n NumberFacet(name='wine_vintage', value=2000)\n ```\n\n: Exceptions\n\n TypeError\n\n : Value supplied is not numeric.\n\n ValueError\n\n : Value is out of range."]]