次の方法で共有


ScoringProfile クラス

検索クエリのスコアリングに影響を与える検索インデックスのパラメーターを定義します。

Azure に送信するには、必要なすべてのパラメーターを設定する必要があります。

継承
azure.search.documents.indexes._generated._serialization.Model
ScoringProfile

コンストラクター

ScoringProfile(*, name: str, text_weights: _models.TextWeights | None = None, functions: List[_models.ScoringFunction] | None = None, function_aggregation: str | _models.ScoringFunctionAggregation | None = None, **kwargs: Any)

Keyword-Only パラメータ

名前 説明
name
str

スコアリング プロファイルの名前。 必須。

text_weights
<xref:search_service_client.models.TextWeights>

特定のインデックス フィールドのテキストの一致に基づいてスコアリングを向上させるパラメーター。

functions
list[<xref:search_service_client.models.ScoringFunction>]

ドキュメントのスコアリングに影響を与える関数のコレクション。

function_aggregation
str または <xref:search_service_client.models.ScoringFunctionAggregation>

個々のスコアリング関数の結果を組み合わせる方法を示す 値。 既定値は "Sum" です。 スコアリング関数がない場合は無視されます。 既知の値は、"sum"、"average"、"minimum"、"maximum"、"firstMatching" です。

変数

名前 説明
name
str

スコアリング プロファイルの名前。 必須。

text_weights
<xref:search_service_client.models.TextWeights>

特定のインデックス フィールドのテキストの一致に基づいてスコアリングを向上させるパラメーター。

functions
list[<xref:search_service_client.models.ScoringFunction>]

ドキュメントのスコアリングに影響を与える関数のコレクション。

function_aggregation
str または <xref:search_service_client.models.ScoringFunctionAggregation>

個々のスコアリング関数の結果を組み合わせる方法を示す 値。 既定値は "Sum" です。 スコアリング関数がない場合は無視されます。 既知の値は、"sum"、"average"、"minimum"、"maximum"、"firstMatching" です。

メソッド

as_dict

json.dump を使用してシリアル化できる dict を返します。

高度な使用法では、必要に応じてコールバックをパラメーターとして使用できます。

キーは、Python で使用される属性名です。 Attr_descはメタデータのディクテーションです。 現在、msrest 型の 'type' と RestAPI でエンコードされたキーを持つ 'key' が含まれています。 値は、このオブジェクトの現在の値です。

返される文字列は、キーのシリアル化に使用されます。 戻り値の型がリストの場合、これは階層的な結果のディクトと見なされます。

このファイルの 3 つの例を参照してください。

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

XML シリアル化が必要な場合は、kwargs is_xml=True を渡すことができます。

deserialize

RestAPI 構文を使用して str を解析し、モデルを返します。

enable_additional_properties_sending
from_dict

指定されたキー抽出器を使用してディクテーションを解析し、モデルを返します。

既定では、キー抽出器 (rest_key_case_insensitive_extractor、attribute_key_case_insensitive_extractor、last_rest_key_case_insensitive_extractor) を検討してください

is_xml_model
serialize

このモデルからサーバーに送信される JSON を返します。

これは、 as_dict(full_restapi_key_transformer、keep_readonly=False) のエイリアスです

XML シリアル化が必要な場合は、kwargs is_xml=True を渡すことができます。

as_dict

json.dump を使用してシリアル化できる dict を返します。

高度な使用法では、必要に応じてコールバックをパラメーターとして使用できます。

キーは、Python で使用される属性名です。 Attr_descはメタデータのディクテーションです。 現在、msrest 型の 'type' と RestAPI でエンコードされたキーを持つ 'key' が含まれています。 値は、このオブジェクトの現在の値です。

返される文字列は、キーのシリアル化に使用されます。 戻り値の型がリストの場合、これは階層的な結果のディクトと見なされます。

このファイルの 3 つの例を参照してください。

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

XML シリアル化が必要な場合は、kwargs is_xml=True を渡すことができます。

as_dict(keep_readonly: bool = True, key_transformer: ~typing.Callable[[str, ~typing.Dict[str, ~typing.Any], ~typing.Any], ~typing.Any] = <function attribute_transformer>, **kwargs: ~typing.Any) -> MutableMapping[str, Any]

パラメーター

名前 説明
key_transformer
<xref:function>

キー トランスフォーマー関数。

keep_readonly
既定値: True

戻り値

説明

dict JSON 互換オブジェクト

deserialize

RestAPI 構文を使用して str を解析し、モデルを返します。

deserialize(data: Any, content_type: str | None = None) -> ModelType

パラメーター

名前 説明
data
必須
str

RestAPI 構造体を使用する str。 既定では JSON。

content_type
str

JSON は既定で、application/xml if XML を設定します。

既定値: None

戻り値

説明

このモデルのインスタンス

例外

説明
DeserializationError if something went wrong

enable_additional_properties_sending

enable_additional_properties_sending() -> None

from_dict

指定されたキー抽出器を使用してディクテーションを解析し、モデルを返します。

既定では、キー抽出器 (rest_key_case_insensitive_extractor、attribute_key_case_insensitive_extractor、last_rest_key_case_insensitive_extractor) を検討してください

from_dict(data: Any, key_extractors: Callable[[str, Dict[str, Any], Any], Any] | None = None, content_type: str | None = None) -> ModelType

パラメーター

名前 説明
data
必須

RestAPI 構造体を使用したディクテーション

content_type
str

JSON は既定で、application/xml if XML を設定します。

既定値: None
key_extractors
既定値: None

戻り値

説明

このモデルのインスタンス

例外

説明
DeserializationError if something went wrong

is_xml_model

is_xml_model() -> bool

serialize

このモデルからサーバーに送信される JSON を返します。

これは、 as_dict(full_restapi_key_transformer、keep_readonly=False) のエイリアスです

XML シリアル化が必要な場合は、kwargs is_xml=True を渡すことができます。

serialize(keep_readonly: bool = False, **kwargs: Any) -> MutableMapping[str, Any]

パラメーター

名前 説明
keep_readonly

readonly 属性をシリアル化する場合

既定値: False

戻り値

説明

dict JSON 互換オブジェクト