Is it possible to send data to Solr using POST instead of GET? I use SolrNet and a Windsor container.
Asked
Active
Viewed 1,750 times
1 Answers
6
Yes, it's possible. You have to write a decorator around ISolrConnection
that POSTs instead of GETs.
Installing the decorator is very easy in Windsor:
var container = new WindsorContainer();
container.Register(Component.For<ISolrConnection>()
.ImplementedBy<PostSolrConnection>()
.Parameters(Parameter.ForKey("serverUrl").Eq(serverURL)));
container.AddFacility("solr", new SolrNetFacility(serverURL));
I blogged exactly about this some time ago (decorator code included)
UPDATE: PostSolrConnection is now part of the SolrNet library as SolrNet.Impl.PostSolrConnection

Mauricio Scheffer
- 98,863
- 23
- 192
- 275
-
in ur specified post I think there will be infinite recursion in method public string Post(string relativeUrl, string s), am i right – Ahsan Iqbal Oct 06 '11 at 12:33
-
@AhsanIqbal : no, there is no infinite recursion. – Mauricio Scheffer Oct 06 '11 at 13:37