Facet 类
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Facet
类是一个表示文档 Facet 的抽象基类。该类不应直接进行实例化。
Facet
在模块 google.appengine.api.search
中定义。
属性
Facet
类的实例具有以下属性:
- name
Facet 的名称。Facet 名称的最大长度必须为 MAXIMUM_FIELD_NAME_LENGTH 且符合格式 [A-Za-z][A-Za-z0-9_]*。
- value
Facet 的值可以是字符串、unicode 或数字。
子类
Facet
类具有以下子类:
- AtomFacet 类
一个 Facet,其内容可被视为用于索引的单个令牌。
此 Facet 的值可以是字符串或 unicode 对象,且被视为不可分割的文本值。以下示例显示了名为 wine_type 的 atom facet:
AtomFacet(name='wine_type', value='Red')
-
异常
- TypeError
提供的值不是文本字符串。
- ValueError
值超过最大允许长度。
- NumberFacet 类
一个 Facet,具有数值。
以下示例显示了名为 wine_vintage 的数字 facet:
NumberFacet(name='wine_vintage', value=2000)
-
异常
- TypeError
提供的值不是数字。
- ValueError
值超出范围。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2023-12-09。
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻译问题"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"易于理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"解决了我的问题"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]