Multi-core with built-in container

366 views
Skip to first unread message

Mauricio Scheffer

unread,
Nov 24, 2009, 8:42:03 AM11/24/09
to SolrNet
Have you tried this?

class Core0Entity {...}
class Core1Entity {...}
Startup.Init<Core0Entity>("http://localhost/solr/core0");
Startup.Init<Core1Entity>("http://localhost/solr/core1");


> Feature request:
> Enabling the use of multi core feature of Solr using ServiceLocator.
> Since the singelton pattern implemented with the ServiceLocator when
> initiating with Startup.Init<T>(solrUrl) it seems impossible to
> control the url pattern besides the query parameters when invoking
> ServiceLocator.Current.GetInstance<ISolrOperations<T>>()

vito256

unread,
Nov 24, 2009, 2:16:18 PM11/24/09
to SolrNet
Won't this solution couple the serialization with the core?

On Nov 24, 3:42 pm, Mauricio Scheffer <mauricioschef...@gmail.com>
wrote:

Mauricio Scheffer

unread,
Nov 24, 2009, 3:20:47 PM11/24/09
to SolrNet
Nope. Startup.Init<T>() initializes all document-type-specific
components, so each document type gets its own serializer. (
http://code.google.com/p/solrnet/source/browse/trunk/SolrNet/Startup.cs
), so this should work.

Or did you mean another mapping manager? Do you want to map core0-
entities with attributes and core1-entities with another method?

David Ginzburg

unread,
Nov 24, 2009, 5:57:25 PM11/24/09
to sol...@googlegroups.com
I wanted to use <T> type for more than one core

--

You received this message because you are subscribed to the Google Groups "SolrNet" group.
To post to this group, send email to sol...@googlegroups.com.
To unsubscribe from this group, send email to solrnet+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/solrnet?hl=en.



Mauricio Scheffer

unread,
Nov 24, 2009, 6:24:01 PM11/24/09
to SolrNet
Ok, you can do this just as I explained here:
http://groups.google.com/group/solrnet/msg/56bacbb78e2f45b3

Use the Startup code as reference: http://code.google.com/p/solrnet/source/browse/trunk/SolrNet/Startup.cs

You'll have to use different component names (see the
Container.Register overloads that take a string key as parameter:
http://code.google.com/p/solrnet/source/browse/trunk/SolrNet/Utils/Container.cs#70
) since the T type is the same.
You'll also need to resolve by type+name, not just by type.

However, I don't see the point in having two different cores with the
same schema within the same application (?)

Also, while it is possible to do all this with the built-in container,
I strongly recommend using a full-blown container like Windsor for non-
trivial integration cases.
> > solrnet+u...@googlegroups.com<solrnet%2Bunsu...@googlegroups.com >
> > .

Mauricio Scheffer

unread,
Nov 25, 2009, 4:13:10 PM11/25/09
to SolrNet
If you're looking to do multi-tenancy, I recommend using Windsor's
IHandlerSelector, see:

http://ayende.com/Blog/archive/2008/10/05/windsor-ihandlerselector.aspx
http://mikehadlow.blogspot.com/2008/11/multi-tenancy-part-2-components-and.html
http://bartreyserhove.blogspot.com/2009/02/building-multi-tenant-applications-with.html

On Nov 24, 8:24 pm, Mauricio Scheffer <mauricioschef...@gmail.com>
wrote:
> Ok, you can do this just as I explained here:http://groups.google.com/group/solrnet/msg/56bacbb78e2f45b3
>
> Use the Startup code as reference:http://code.google.com/p/solrnet/source/browse/trunk/SolrNet/Startup.cs
>
> You'll have to use different component names (see the
> Container.Register overloads that take a string key as parameter:http://code.google.com/p/solrnet/source/browse/trunk/SolrNet/Utils/Co...

Joe

unread,
May 31, 2018, 8:55:38 AM5/31/18
to SolrNet
Hello, where is Startup defined?   In my code, I have specified Startup.Init<SolrSearchResult>(http://localhost:8080/solr); but not sure how to declare Startup.
Reply all
Reply to author
Forward
0 new messages