クラス RescoringMatchScorer
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
クラス RescoringMatchScorer
を使用すると、クエリの一致の質に基づいてドキュメントの並べ替えができます。これは MatchScorer に似ていますが、一致語句の出現頻度やフィールド タイプなどの係数に基づいて、より複雑なスコア アルゴリズムを使用します。このアルゴリズムは継続的に修正されています。また、事前の通知なく変更される場合があります。このスコアラーを使用する検索結果の順番も、事前の通知なく変更される可能性があります。
RescoringMatchScorer
を使用するには、次のコードのように SortOptions
に追加します。
sort_opts = search.SortOptions(match_scorer=search.RescoringMatchScorer())
このコードは、スコアの降順で文書を並べ替えます。スコアは正の数になります。
昇順で並べ替えるには、次のコードを使用します。
sort_opts = search.SortOptions(match_scorer=search.RescoringMatchScorer(),
expressions=[search.SortExpression(
expression='_score', direction=search.SortExpression.ASCENDING,
default_value=0.0)])
この場合のスコアは負の値です。
RescoringMatchScorer
は、google.appengine.api.search
モジュールで定義されます。
コンストラクタ
RescoringMatchScorer
クラスのコンストラクタは、次のように定義されます。
- class RescoringMatchScorer()
文書のスコアを検索結果に割り当て、文書内での語句の出現頻度やドキュメント部分の重要度に基づいて、クエリの一致度を表します。
結果値
RescoringMatchScorer
クラスの新しいインスタンス。
例外
- TypeError
いずれかのパラメータが無効なタイプであるか、不明な属性が渡されました。
- ValueError
いずれかのパラメータの値が無効です。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-04-03 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-04-03 UTC。"],[[["`RescoringMatchScorer` sorts documents by query match quality using a complex algorithm that considers term frequency and field type."],["The scoring algorithm used by `RescoringMatchScorer` is subject to change, potentially impacting the order of search results."],["Documents are sorted in descending order by default using `RescoringMatchScorer`, resulting in positive scores."],["To sort in ascending order, use `SortExpression` with the `_score` expression and `ASCENDING` direction, which results in negative scores."],["`RescoringMatchScorer` is available in first-generation runtimes and can be used when upgrading to corresponding second-generation runtimes."]]],[]]