Mauricio, thank for POST-variant implementation, but looks like it not work for today.
My problem is next: We have many Solr shards on different servers, with basic authentication (impletent it you help me earlier - tnx you). But now we faced with 400 - Bad request error. Guys from "Java develompent side" of team helped me with localizing it - GET requests causes this error.
Now we need implement POST Solr request with multiple shards and Windsor.
Early I have this (for standard GET implementation):
public static void RegisterFacility<T>(IEnumerable<ShardOptions> shardOptions, string baseHttpUrl = null)
{
SolrNetFacility facility = null;
if (baseHttpUrl != null)
{
facility = new SolrNetFacility(baseHttpUrl);
}
else
{
facility = new SolrNetFacility();
}
foreach (var shard in shardOptions)
{
var coreName = "core_" + Guid.NewGuid();
facility.AddCore(coreName, typeof(T), shard.HttpUrl);
RegisteredCores.Add(coreName, shard);
}
container.AddFacility(facility);
}
And resolve cores for querying:
var core = container.Resolve<ISolrOperations<T>>(coreName);
Now I implement next injection:
container.Register(Component.For<ISolrConnection>().ImplementedBy<PostSolrConnection>().DependsOn(new { serverURL=baseHttpUrl}));
But after core resolving in debug Server Connection is SolrConnection and request is GET.
Ask for any help, tnx!
Вівторок, 13 вересня 2011 р. 15:14:46 UTC+3 користувач Mauricio Scheffer написав: