FieldMappingFunction Class

Definition

Represents a function that transforms a value from a data source before indexing.

public class FieldMappingFunction : System.ClientModel.Primitives.IJsonModel<Azure.Search.Documents.Indexes.Models.FieldMappingFunction>, System.ClientModel.Primitives.IPersistableModel<Azure.Search.Documents.Indexes.Models.FieldMappingFunction>
type FieldMappingFunction = class
    interface IJsonModel<FieldMappingFunction>
    interface IPersistableModel<FieldMappingFunction>
Public Class FieldMappingFunction
Implements IJsonModel(Of FieldMappingFunction), IPersistableModel(Of FieldMappingFunction)
Inheritance
FieldMappingFunction
Implements

Constructors

Name Description
FieldMappingFunction(String)

Initializes a new instance of FieldMappingFunction.

Properties

Name Description
Name

The name of the field mapping function.

Parameters

A dictionary of parameter name/value pairs to pass to the function. Each value must be of a primitive type.

To assign an object to the value of this property use FromObjectAsJson<T>(T, JsonSerializerOptions).

To assign an already formatted json string to this property use FromString(String).

Examples:

  • BinaryData.FromObjectAsJson("foo"). : Creates a payload of "foo".
  • BinaryData.FromString("\"foo\""). : Creates a payload of "foo".
  • BinaryData.FromObjectAsJson(new { key = "value" }). : Creates a payload of { "key": "value" }.
  • BinaryData.FromString("{\"key\": \"value\"}"). : Creates a payload of { "key": "value" }.

Methods

Name Description
JsonModelCreateCore(Utf8JsonReader, ModelReaderWriterOptions)
JsonModelWriteCore(Utf8JsonWriter, ModelReaderWriterOptions)
PersistableModelCreateCore(BinaryData, ModelReaderWriterOptions)
PersistableModelWriteCore(ModelReaderWriterOptions)

Explicit Interface Implementations

Name Description
IJsonModel<FieldMappingFunction>.Create(Utf8JsonReader, ModelReaderWriterOptions)

Reads one JSON value (including objects or arrays) from the provided reader and converts it to a model.

IJsonModel<FieldMappingFunction>.Write(Utf8JsonWriter, ModelReaderWriterOptions)

Writes the model to the provided Utf8JsonWriter.

IPersistableModel<FieldMappingFunction>.Create(BinaryData, ModelReaderWriterOptions)

Converts the provided BinaryData into a model.

IPersistableModel<FieldMappingFunction>.GetFormatFromOptions(ModelReaderWriterOptions)

Gets the data interchange format (JSON, Xml, etc) that the model uses when communicating with the service.

IPersistableModel<FieldMappingFunction>.Write(ModelReaderWriterOptions)

Writes the model into a BinaryData.

Applies to