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 1 year 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

@christothes @JonathanCrd

github-actions[bot] avatar Jun 20 '24 16:06 github-actions[bot]

Thank you for your feedback. Tagging and routing to the team member best able to assist.

github-actions[bot] avatar Jun 20 '24 16:06 github-actions[bot]

This issue seems to be related to Azure.Search.Documents and not to Azure.Data.Tables. I'm assigning it to the proper team.

JonathanCrd avatar Jun 24 '24 20:06 JonathanCrd

Thanks for reaching out and we regret that you're experiencing difficulties. The Azure SDK packages do not have insight nor influence over an operation failure, they just surface the HTTP error returned by the Search service. As a result, this is not an issue that the Azure SDK team can assist with. You will need assistance from the Azure Search service team.

To ensure that the right team has visibility and can help, your best path forward for would be to open an Azure support request or inquire on the Microsoft Q&A site or Azure Search · Community.

CC: @mattgotteiner

ShivangiReja avatar Jun 25 '24 14:06 ShivangiReja

Hi @Debro012. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation.

github-actions[bot] avatar Jun 25 '24 14:06 github-actions[bot]

Thanks, I'll take a look at this

mattgotteiner avatar Jun 26 '24 18:06 mattgotteiner

I can reproduce the problem. Here's another payload:

PUT https://{{service}}.search.windows.net/indexes/testsemantic?api-version=2024-03-01-preview
Content-Type: application/json
Authorization: Bearer {{token}}

{
    "name": "testsemantic",
    "fields": [
        { "name": "id", "type": "Edm.String", "key": true },
        { "name": "content", "type": "Collection(Edm.ComplexType)", "fields": [ { "name": "str", "type": "Edm.String" } ] }
    ],
    "semantic": {
        "configurations": [
            {
                "name": "config",
                "prioritizedFields": {
                    "prioritizedKeywordsFields": [
                        { "fieldName": "content/str" }
                    ]
                }
            }
        ]
    }
}

I get the following reply

{
  "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"
      }
    ]
  }
}

mattgotteiner avatar Jun 26 '24 23:06 mattgotteiner

We will check to determine if we can update the documentation here

mattgotteiner avatar Jun 26 '24 23:06 mattgotteiner

Hi @Debro012, since you haven’t asked that we /unresolve the issue, we’ll close this out. If you believe further discussion is needed, please add a comment /unresolve to reopen the issue.

github-actions[bot] avatar Jul 04 '24 04:07 github-actions[bot]