FieldExpression 类
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
FieldExpression
类可让您为搜索返回的每个结果计算自定义的内容片段。
FieldExpression
在模块 google.appengine.api.search
中定义。
构造函数
FieldExpression
类的构造函数定义如下:
-
class FieldExpression(name, expression)
构造类 FieldExpression
的实例。
例如,
FieldExpression(name='content_snippet',
expression='snippet("very important", content)')
构造一个字段表达式,该表达式会为每个搜索结果返回一个名为 content-snippet
的计算字段,其中包含与查询 "very
important"
匹配的 content
字段的 HTML 片段。
参数
- name
计算字段的名称。
- expression
用于求值并返回值的表达式。
结果值
FieldExpression
类的新实例。
异常
- TypeError
参数类型无效或者传递了未知属性。
- ValueError
参数赋值无效。
属性
FieldExpression
类的实例具有以下属性:
- name
计算字段的名称。
- expression
一个字符串,包含用于求值并返回值的表达式。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-01-30。
[[["易于理解","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-01-30。"],[],[]]