How to Configure Your Azure Cognitive Search Target
The following topics describe how to create an Azure Cognitive Search Target in Connectivity Hub. For more information about Targets, see What is a Target?
Prerequisites
-
Before you can add your target, you must install BA Insight Connectivity Hub.
- Before you proceed to add and configure your Azure Cognitive Search Target, you must create an index in Microsoft Azure.
Index-to-Content Source
In Connectivity Hub, there is one index created per content source for both Elasticsearch and Azure Cognitive Search.
Create a Microsoft Azure index
In order to create a Microsoft Azure index with the 2023-10-01-Preview API version, use the following steps:
-
Install an API management platform (Postman, Insomnia, etc.).
-
Create a PUT request. For example:
CopyPUT https://[servicename].search.windows.net/indexes/[index name]?api-version=[api-version]
Content-Type: application/json
api-key: [admin key] -
Provide the body of the request. The code snippet below describes creating an index with the id field (required), a vector field, and the vector search configuration.
Note the following:- The dimensions attribute of vector field has a minimum of 2 and a maximum of 2048 floating point values each.
- The size of embeddings generated by the Open AI's text-embedding-ada-002 model is 1536, the LLM used in our sample is 1536.
Copy{
"fields": [
{"name": "id", "type": "Edm.String", "searchable": true, "filterable": true, "retrievable": true, "sortable": true, "facetable": true, "key": true, "indexAnalyzer": null, "searchAnalyzer": null, "analyzer": "standard.lucene", "normalizer": null, "dimensions": null, "vectorSearchProfile": null, "synonymMaps": []},
{"name": "vector_field", "type": "Collection(Edm.Single)", "searchable": true, "filterable": false, "retrievable": true, "sortable": false, "facetable": false, "key": false, "indexAnalyzer": null, "searchAnalyzer": null, "analyzer": null, "normalizer": null, "dimensions": 1536, "vectorSearchProfile": "vector-profile-hnsw1", "synonymMaps": []}
],
"scoringProfiles": [],
"corsOptions": null,
"suggesters": [],
"analyzers": [],
"normalizers": [],
"tokenizers": [],
"tokenFilters": [],
"charFilters": [],
"encryptionKey": null,
"similarity": {
"@odata.type": "#Microsoft.Azure.Search.BM25Similarity",
"k1": null,
"b": null
},
"semantic": null,
"vectorSearch": {
"algorithms": [
{
"name": "my-hnsw-config-1",
"kind": "hnsw",
"hnswParameters": {
"m": 4,
"efConstruction": 400,
"efSearch": 500,
"metric": "cosine"
}
}
],
"profiles": [
{
"name": "vector-profile-hnsw1",
"algorithm": "my-hnsw-config-1"
}
]
}
} -
Execute the request.
-
Validate that the index and the vector fields were created in the Microsoft Azure portal.
Add the Microsoft Azure Search integration target
You can add as many targets to connectivity as you like. A target is associated with a specific Microsoft Azure Search service. More than one target can point to the same Azure search service. To addd the Microsoft Azure Search itnegration target, do the following:
-
In Connectivity Hub, navigate to the Target page and select New Target.
-
On the Load target page, select your target from the drop-down menu.
-
Select the Target Info tab and specify a name for your target in the Title field.
- Select the General Settings tab and configure the general settings. For more information on configuring these fields, see the target general settings reference.
-
Select the Custom Settings tab and specify the following fields:
-
Search Service Name (required): Enter the name of your Microsoft Azure Search service.
-
Password (required): Enter the admin key (with full permissions) for you Microsoft Azure Search service.
-
DNS Suffix: Enter the custom DNS suffix to be used when connecting to the Microsoft Azure Search service.
-
This is required if you are connecting to a custom cloud, such as a government cloud.
-
Do not specify this suffix for the public Microsoft Azure Cloud.
-
-
-
Click Save.
Schema Mapping
To plan your Azure Cognitive Search schema, consider the fields you wish to include in your search.
- To configure the fields you want to see in your index, navigate to the Metadata page for your Content Source by clicking Content Source > > Edit Metadata.
- Set the Active, Refinable, Searchable, and Exact match settings for your metadata.
- The fields are automatically created in your index, based on these settings.
- Retrievable:
- Select this for any field you wish to return with the search results.
- Generally, these are fields that are used as part of your displayed result.
- Refinable:
- Select this for any field which might be explicitly searched or used by a refiner.
- For example, a title search: "title = 'Mary had a little lamb'".
- Searchable:
- Select this for any field which should be searched for the keywords used in your query.
Complex Fields
Table data types from Connectivity Hub will be treated as Collection of Complex fields in Azure Cognitive Search schema.
Azure target cannot create these complex fields, so they require manual input:
You need to add the table field and all its sub-fields in you Azure index and then repeat the full crawl.