Class FieldMapping
java.lang.Object
com.azure.search.documents.indexes.models.FieldMapping
- All Implemented Interfaces:
com.azure.json.JsonSerializable<FieldMapping>
public final class FieldMapping
extends Object
implements com.azure.json.JsonSerializable<FieldMapping>
Defines a mapping between a field in a data source and a target field in an index.
-
Constructor Summary
ConstructorsConstructorDescriptionFieldMapping(String sourceFieldName) Creates an instance of FieldMapping class. -
Method Summary
Modifier and TypeMethodDescriptionstatic FieldMappingfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of FieldMapping from the JsonReader.Get the mappingFunction property: A function to apply to each source field value before indexing.Get the sourceFieldName property: The name of the field in the data source.Get the targetFieldName property: The name of the target field in the index.setMappingFunction(FieldMappingFunction mappingFunction) Set the mappingFunction property: A function to apply to each source field value before indexing.setTargetFieldName(String targetFieldName) Set the targetFieldName property: The name of the target field in the index.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
FieldMapping
Creates an instance of FieldMapping class.- Parameters:
sourceFieldName- the sourceFieldName value to set.
-
-
Method Details
-
getSourceFieldName
Get the sourceFieldName property: The name of the field in the data source.- Returns:
- the sourceFieldName value.
-
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.
-
setTargetFieldName
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.
-
getMappingFunction
Get the mappingFunction property: A function to apply to each source field value before indexing.- Returns:
- the mappingFunction value.
-
setMappingFunction
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.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<FieldMapping>- Throws:
IOException
-
fromJson
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:
IllegalStateException- If the deserialized JSON object was missing any required properties.IOException- If an error occurs while reading the FieldMapping.
-