SearchResults クラス
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
SearchResults
クラスは、Index.search()
を使用して検索リクエストを実行した結果を表します。
SearchResults
は、google.appengine.api.search
モジュールで定義されます。
コンストラクタ
SearchResults
クラスのコンストラクタは、次のように定義されます。
- class SearchResults(number_found, results=None, cursor=None)
検索サービスに対してインデックスのクエリを要求し、該当のクエリについてパラメータを指定します。
引数
- number_found
クエリについて見つかったドキュメントの数。
- results
検索要求の実行により返された ScoredDocument オブジェクトのリスト。
- cursor
現在の検索結果の最後から検索を続行できるようにする Cursor オブジェクト。
結果値
Index.search() を実行した結果を表す SearchRequest
クラスの新しいインスタンス。
例外
- TypeError
いずれかのパラメータが無効なタイプであるか、不明な属性が渡されました。
- ValueError
いずれかのパラメータの値が無効です。
プロパティ
SearchResults
クラスのインスタンスには次のプロパティがあります。
- results
クエリに一致する ScoredDocument オブジェクトのリストを返します。
- number_found
クエリに一致するドキュメントの概数を返します。検索結果の後処理を定義する QueryOptions
。たとえば、QueryOptions.number_found_accuracy
パラメータを 100 に設定すると、number_found
が 100 以下の場合には正確となります。
- cursor
- このフィールドに値を入力するには、検索の QueryOptions にカーソルを渡す必要があります。それ以外の場合は、None になります。最終結果から検索を続行する際に使用できる結果カーソルを返します。現在の結果の後に結果がない場合は、None を返します。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 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。"],[[["`SearchResults` represents the outcome of a search request made using `Index.search()` and is found within the `google.appengine.api.search` module."],["The `SearchResults` constructor takes parameters such as `number_found`, `results` (a list of `ScoredDocument` objects), and `cursor` to manage search results and pagination."],["The `results` property of `SearchResults` provides a list of `ScoredDocument` objects that match the search query."],["The `number_found` property offers an approximate count of documents that match the query, with accuracy influenced by the `QueryOptions.number_found_accuracy` parameter."],["The `cursor` property can be used to continue a search from where the last result left off if a cursor is included in the search's `QueryOptions`, otherwise it will be None."]]],[]]