azure-sdk-for-net icon indicating copy to clipboard operation
azure-sdk-for-net copied to clipboard

[BUG] Semantic configuration properties for prioritized keyword fields not accepting string subfields of type Collection(Edm.ComplextType)

Open Debro012 opened this issue 2 months ago • 8 comments

Library name and version

All versions

Describe the bug

Semantic configuration properties for prioritized keyword fields not accepting string subfields of type Collection(Edm.ComplextType). Even though this is stated as supported in MS documentation:

Across all semantic configuration properties, the fields you assign must be: -Attributed as searchable and retrievable -Strings of type Edm.String, Collection(Edm.String), string subfields of Collection(Edm.ComplexType)

Expected behavior

strings subfields of type Collection(Edm.ComplexType) being accepted as semantic configuration properties of prioritized keyword fields.

Actual behavior

{ "error": { "code": "InvalidRequestParameter", "message": "The request is invalid. Details: definition : Semantic configurations support fields of type Edm.String and Collection(Edm.String). Subfields of Edm.ComplexType can be used but subfields of Collection(Edm.ComplexType) are not supported. Please visit https://aka.ms/SemanticConfiguration for more info.", "details": [ { "code": "InvalidSemanticConfiguration", "message": "Semantic configurations support fields of type Edm.String and Collection(Edm.String). Subfields of Edm.ComplexType can be used but subfields of Collection(Edm.ComplexType) are not supported. Please visit https://aka.ms/SemanticConfiguration for more info. Parameters: definition" } ] } }

Reproduction Steps

Pass a payload to the Azure AI Search service instance for index creation:

{
	"name": "indexName",
	"fields": [
		{
			"name": "title",
			"type": "Edm.String",
			"searchable": true,
			"filterable": true,
			"retrievable": true,
			"sortable": false,
			"facetable": false,
			"key": false,
			"indexAnalyzer": null,
			"searchAnalyzer": null,
			"analyzer": null,
			"dimensions": null,
			"vectorSearchProfile": null,
			"synonymMaps": []
		},
		{
			"name": "metadata_spo_item_path",
			"type": "Edm.String",
			"key": false,
			"searchable": false,
			"filterable": false,
			"sortable": false,
			"facetable": false
		},
		{
			"name": "metadata_spo_item_content_type",
			"type": "Edm.String",
			"key": false,
			"searchable": false,
			"filterable": true,
			"sortable": false,
			"facetable": true
		},
		{
			"name": "metadata_spo_item_last_modified",
			"type": "Edm.DateTimeOffset",
			"key": false,
			"searchable": false,
			"filterable": false,
			"sortable": true,
			"facetable": false
		},
		{
			"name": "metadata_spo_item_size",
			"type": "Edm.Int64",
			"key": false,
			"searchable": false,
			"filterable": false,
			"sortable": false,
			"facetable": false
		},
		{
			"name": "people",
			"type": "Collection(Edm.ComplexType)",
			"fields": [
				{
					"name": "LookupId",
					"type": "Edm.Int32",
					"searchable": false,
					"filterable": true,
					"sortable": false,
					"facetable": false
				},
				{
					"name": "LookupValue",
					"type": "Edm.String",
					"searchable": true,
					"filterable": true,
					"sortable": false,
					"facetable": false,
					"retrievable": true
				},
				{
					"name": "Email",
					"type": "Edm.String",
					"searchable": true,
					"filterable": true,
					"sortable": false,
					"facetable": false,
					"retrievable": true
				}
			]
		}
	],
	"scoringProfiles": [],
	"corsOptions": null,
	"suggesters": [],
	"analyzers": [],
	"tokenizers": [],
	"tokenFilters": [],
	"charFilters": [],
	"similarity": {
		"@odata.type": "#Microsoft.Azure.Search.BM25Similarity",
		"k1": null,
		"b": null
	},
	"semantic": {
		"defaultConfiguration": "config-name",
		"configurations": [
			{
				"name": "config-name",
				"prioritizedFields": {
					"titleField": {
						"fieldName": "title"
					},
					"prioritizedContentFields": [
						{
							"fieldName": "chunk"
						}
					],
					"prioritizedKeywordsFields": [
						{
							"fieldName": "topic"
						},
						{
							"fieldName": "people/LookupValue"
						},
						{
							"fieldName": "people/Email"
						}
					]
				}
			}
		]
	},
	"vectorSearch": {
		"algorithms": [
			{
				"name": "alg-name",
				"kind": "hnsw",
				"hnswParameters": {
					"metric": "cosine",
					"m": 4,
					"efConstruction": 400,
					"efSearch": 500
				},
				"exhaustiveKnnParameters": null
			}
		],
		"profiles": [
			{
				"name": "profile-name",
				"algorithm": "alg-name"
			}
		]
	}
}

Environment

No response

Debro012 avatar Jun 20 '24 16:06 Debro012