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 Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-03-06 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-03-06 UTC。"],[[["`FieldExpression` enables the computation of custom content snippets for each search result."],["This API is available for first-generation runtimes and is applicable when upgrading to second-generation runtimes."],["The `FieldExpression` constructor takes a `name` for the computed field and an `expression` to define how the content is generated."],["The properties `name` and `expression` hold the name of the computed field and the string defining its expression, respectively."],["`FieldExpression` will raise a TypeError or ValueError exception if invalid types or values are passed during instantiation."]]],[]]