Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.26k stars 4.6k forks source link

[BUG] Azure.Search.Documents returns 'Parital Content' Error for semantic hybrid search #44673

Closed mehnoorsiddiqui closed 3 months ago

mehnoorsiddiqui commented 3 months ago

Library name and version

Azure.Search.Documents 11.5.1

Describe the bug

We are integrating the Azure AI search semantic hybrid search service. The uploaded documents contain a unique key and five searchable fields. Out of five one is a vector field.

While performing semantic hybrid search and semantic-only search, the SDK throws a 206 partial content error. If I send the request excluding the vector field using the filter parameter then the request is successful with 200 status code.

Expected behavior

Successful response with a 200 status code

Actual behavior

image

Reproduction Steps

Upload the document to Azure AI search with three fields, two non-vector fields, and one vector

Perform the semantic hybrid search similar to the code snippet shown below:

var searchOptions = new SearchOptions
{
    VectorSearch = new()
    {
    Queries = { new VectorizedQuery(queryEmbeddings.ToArray()) { KNearestNeighborsCount = 3, Fields = { "ContentVector" } } }
    },
    SemanticSearch = new()
    {
        SemanticConfigurationName = "training-data-semantic-config",
        QueryCaption = new(QueryCaptionType.Extractive),
        QueryAnswer = new(QueryAnswerType.Extractive),
    },
    QueryType = SearchQueryType.Semantic,
    Size = k,
    Select = { "Name", "Description", "Authentication", "Content" }
};

SearchResults<SearchDocument> response = await searchClient.SearchAsync<SearchDocument>(query, searchOptions);

Environment

.NET SDK: Version: 8.0

Runtime Environment: OS Name: Windows 11

github-actions[bot] commented 3 months ago

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

jsquire commented 3 months ago

Hi @mehnoorsiddiqui. 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 maintainers of the Azure SDK 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. I'm going to close this out; if I've misunderstood what you're describing, please let us know in a comment and we'd be happy to assist as we're able.