-
Notifications
You must be signed in to change notification settings - Fork 798
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
How to use dynamic set of cores #614
Comments
Today, I implemented a possible solution for the requirement, which seems to work at first sight. Well, it will be integrated into a multi-container-based and heavily used web application.
And this is the intercepting class, that reads out the host header via _httpContextAccessor.HttpContext, which is neccessary for finding the tenant-Id/contentTreeId.
Instantiation of ISolrService is scoped and this fits well with usual requests in Controllers. BTW: This solution will not work in background tasks where there is no valid _httpContextAccessor.HttpContext. |
Yes, pulling the tenant ID from some injected service is the way to go. |
We have been using Solr.Net for a number of years and now have a new requirement: When the system is started, some new Solr cores may be dynamically created, but they should use the same data type (keyword: multi-tenancy).
So far we have used the following approach with access to exactly one core:
services.AddSolrNet("http://solr:8983/solr/main_core");
services.AddScoped<ISolrService, SolrService<SolrTreeNode, ISolrOperations>>();
How could the new requirement be implemented with Solr.Net?
We will then have many cores, each of type SolrTreeNode:
The text was updated successfully, but these errors were encountered: