Compartir a través de


FieldMapping Class

  • java.lang.Object
    • com.azure.search.documents.indexes.models.FieldMapping

Implements

public final class FieldMapping
implements JsonSerializable<FieldMapping>

Defines a mapping between a field in a data source and a target field in an index.

Constructor Summary

Constructor Description
FieldMapping(String sourceFieldName)

Creates an instance of FieldMapping class.

Method Summary

Modifier and Type Method and Description
static FieldMapping fromJson(JsonReader jsonReader)

Reads an instance of FieldMapping from the JsonReader.

FieldMappingFunction getMappingFunction()

Get the mappingFunction property: A function to apply to each source field value before indexing.

String getSourceFieldName()

Get the sourceFieldName property: The name of the field in the data source.

String getTargetFieldName()

Get the targetFieldName property: The name of the target field in the index.

FieldMapping setMappingFunction(FieldMappingFunction mappingFunction)

Set the mappingFunction property: A function to apply to each source field value before indexing.

FieldMapping setTargetFieldName(String targetFieldName)

Set the targetFieldName property: The name of the target field in the index.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Constructor Details

FieldMapping

public FieldMapping(String sourceFieldName)

Creates an instance of FieldMapping class.

Parameters:

sourceFieldName - the sourceFieldName value to set.

Method Details

fromJson

public static FieldMapping fromJson(JsonReader jsonReader)

Reads an instance of FieldMapping from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of FieldMapping if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

getMappingFunction

public FieldMappingFunction getMappingFunction()

Get the mappingFunction property: A function to apply to each source field value before indexing.

Returns:

the mappingFunction value.

getSourceFieldName

public String getSourceFieldName()

Get the sourceFieldName property: The name of the field in the data source.

Returns:

the sourceFieldName value.

getTargetFieldName

public String getTargetFieldName()

Get the targetFieldName property: The name of the target field in the index. Same as the source field name by default.

Returns:

the targetFieldName value.

setMappingFunction

public FieldMapping setMappingFunction(FieldMappingFunction mappingFunction)

Set the mappingFunction property: A function to apply to each source field value before indexing.

Parameters:

mappingFunction - the mappingFunction value to set.

Returns:

the FieldMapping object itself.

setTargetFieldName

public FieldMapping setTargetFieldName(String targetFieldName)

Set the targetFieldName property: The name of the target field in the index. Same as the source field name by default.

Parameters:

targetFieldName - the targetFieldName value to set.

Returns:

the FieldMapping object itself.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to