Skip to content

[BUG] "The 'queryRewrites' feature can only be enabled for queries going through the semantic reranking process to score the top results.\r\nParameter name: queryRewrites" thrown when no Size value set #48183

Open
@zfmsf

Description

@zfmsf

Library name and version

Azure.Search.Documents.SearchOptions v11.7.0-beta.2

Describe the bug

When no "Size" value set in SearchOptions, after the first request with default skip = 0 sent, multiple consecutive requests will be sent, increments the skip value by 50 for each of them to retrieve all indexed documents.
However, QR doesn't accept a skip value of 50 or more, resulting an error - "The 'queryRewrites' feature can only be enabled for queries going through the semantic reranking process to score the top results.\r\nParameter name: queryRewrites"

Expected behavior

Query rewrite feature should work even if no Size value is explicitly set.

Actual behavior

Query rewrite feature doesn't work if no Size value is explicitly set.

Reproduction Steps

private static readonly SearchOptions QueryOptions = new()
{
QueryType = SearchQueryType.Semantic,
QueryLanguage = QueryLanguage.EnUs,
QuerySpeller = QuerySpellerType.Lexicon,
IncludeTotalCount = true,
SemanticSearch = new SemanticSearchOptions
{
SemanticConfigurationName = ConfigName,
QueryCaption = new QueryCaption(QueryCaptionType.Extractive),
QueryRewrites = new QueryRewrites(QueryRewritesType.Generative) { Count = 5 },
QueryAnswer = new QueryAnswer(QueryAnswerType.Extractive) { Count = 5 },
Debug = QueryDebugMode.QueryRewrites
}
};

Response<SearchResults> response = await searchClient.SearchAsync(Query, QueryOptions);
SearchResults results = response.Value;
SearchResult[] resultsArray = results.GetResults().ToArray();

Environment

No response

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.Searchcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions