Description
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