@김상권 The index defined in the Azure Cognitive Search service and the index used in the AzureCognitiveSearchChatExtensionConfiguration are two different indexes. The index defined in the Azure Cognitive Search service is used to store and search the data, while the index used in the AzureCognitiveSearchChatExtensionConfiguration is used to map the data from the search index to the chat extension.
When you create an AzureCognitiveSearchChatExtensionConfiguration, you need to specify the index name, the field mappings, and other settings. The field mappings define how the data from the search index is mapped to the chat extension. If the field mappings are not defined correctly, you may get unexpected results.
In your case, it seems like the field mappings are not defined correctly, which is why you are getting different results in the search service and the OpenAIClient. You need to define the field mappings correctly to map the data from the search index to the chat extension.
To set the key in the desired way for a Delimited type of file whose first line includes a header, you can use the "delimitedTextHeaders" parameter in the indexer definition. This parameter specifies the headers in the delimited text file. For example:
{
"name": "my-indexer",
"dataSourceName": "my-data-source",
"targetIndexName": "my-index",
"parameters": {
"configuration": {
"parsingMode": "delimitedText",
"delimitedTextHeaders": "id, name, department"
}
}
}
Here, "id", "name", and "department" are the headers in the delimited text file. You can replace them with the headers in your file.