Implications of using AzureSearch SDK with static Dictionary of 30-40 ISearchIndexClients

Deadly 提交于 2019-12-02 04:35:28

This strategy will probably not scale to the number of indexes you want. The most likely outcome is that you will exhaust the pool of available TCP connections. A better approach would be to implement a cache of SearchIndexClient instances keyed by index name. On a cache miss, you could get exclusive access to the least-recently-used client and set the IndexName property on it. That settable property was added to SearchIndexClient for exactly this scenario (note that it replaces the deprecated TargetDifferentIndex method).

You can find more discussions and background information about the implications of sharing SearchIndexClients on GitHub, the MSDN forums, and this related StackOverflow question.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!