Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[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 opened this issue Feb 7, 2025 · 1 comment
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Search

Comments

@zfmsf
Copy link

zfmsf commented Feb 7, 2025

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

@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Search labels Feb 7, 2025
Copy link

github-actions bot commented Feb 7, 2025

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

@jsquire jsquire assigned kinelski and unassigned ShivangiReja Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Search
Projects
None yet
Development

No branches or pull requests

3 participants