You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Motivation and Context (Why the change? What's the scenario?)
The `UseSessionId` property on the `SearchOptions` can help improve the
relevance of search results when multiple replicas are configured. This
should be the case in any production deployment as two replicas are
required for high availability of read-only workloads (queries), and
three or more for high availability of read-write workloads (queries and
indexing).
> A value to be used to create a sticky session, which can help getting
more consistent results. As long as the same sessionId is used, a
best-effort attempt will be made to target the same replica set. Be wary
that reusing the same sessionID values repeatedly can interfere with the
load balancing of the requests across replicas and adversely affect the
performance of the search service. The value used as sessionId cannot
start with a '_' character.
https://learn.microsoft.com/en-us/rest/api/searchservice/documents/search-post?view=rest-searchservice-2024-07-01&tabs=HTTP#request-body
Using this setting should also provide more consistent results from the
`AzureAISearchMemory.GetListAsync` method. Without an `orderby`
parameter results are sorted by score, and when `*` is used as the
search query, all results have the same score of `1`. This increases the
likelihood of getting inconsistent results when the search query hits
different replicas.
---------
Co-authored-by: Devis Lucato <[email protected]>
0 commit comments