Facet クラス
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Facet
クラスは、ドキュメントのファセットを表す基本の抽象クラスです。このクラスは直接インスタンス化できません。
Facet
は、google.appengine.api.search
モジュールで定義されます。
プロパティ
Facet
クラスのインスタンスには次のプロパティがあります。
- name
ファセットの名前。ファセット名は MAXIMUM_FIELD_NAME_LENGTH 文字以内で指定し、パターン「[A-Za-z][A-Za-z0-9_]*」に一致している必要があります。
- value
ファセットの値。文字列、Unicode、または数値で指定します。
サブクラス
Facet
クラスには次のサブクラスがあります。
- class AtomFacet
インデックスに登録するため、単一のトークンとして扱われるコンテンツを持つファセット。
ファセットの値は、非表示のテキスト値として処理される文字列または Unicode オブジェクトです。次の例は、wine_type という名前のアトム ファセットを示します。
AtomFacet(name='wine_type', value='Red')
-
例外
- TypeError
指定された値がテキスト文字列ではありません。
- ValueError
値が、許容される長さの上限を超えています。
- class NumberFacet
数値を持つファセット。
次の例は wine_vintage という名前の数値ファセットを示しています。
NumberFacet(name='wine_vintage', value=2000)
-
例外
- TypeError
指定された値が数字ではありません。
- ValueError
範囲外の値が使われています。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 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。"],[[["The `Facet` class is an abstract base class for representing document facets and should not be directly instantiated."],["`Facet` objects have properties for a `name`, which must follow a specific format and length restriction, and a `value`, which can be a string, unicode, or number."],["`AtomFacet` is a subclass of `Facet` 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."],["`NumberFacet` is another subclass of `Facet` where the value is numeric, with errors raised if a non-numeric value is provided or if the value is out of range."],["The `Facet` 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."]]],[]]