To achieve your scenario, you can create a field mapping for the id column by changing the datatype to edm.int32.
To do this, you will need to add a field mapping to the "fieldMappings" array of your indexer definition. The field mapping should consist of three parts:
1.sourceFieldName: This is the name of the field in your data source (in this case, the id column in your Azure SQL database).
- targetFieldName: This is the name of the field in your search index. If you want to keep the same name as the source field, you can omit this property.
- mappingFunction: This is an optional property that allows you to apply a predefined function to transform the data. In this case, you don't need to use a mapping function as you are just changing the data type.
Here's an example of how your field mapping would look like:
"fieldMappings": [ { "sourceFieldName": "id", "targetFieldName": "id", "mappingFunction": null } ]
This should map the id column in your Azure SQL database to the id field in your search index and change the data type to edm.int32
See this Azure doc for more information on field mapping and supported data types in Azure Cognitive Search
hope that helps.
-Grace