3

Is it possible to send data to Solr using POST instead of GET? I use SolrNet and a Windsor container.

Dmytro Shevchenko
  • 33,431
  • 6
  • 51
  • 67
Ahsan Iqbal
  • 1,422
  • 5
  • 20
  • 39

1 Answers1

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