godong9 / solr-node

Simple Solr Node Client Project.
MIT License
25 stars 25 forks source link

Add configuration option for setting solr endpoint by single connection string #75

Open misino opened 5 years ago

misino commented 5 years ago

Single configuration option for solr endpoint will make integration with other projects easier.

godong9 commented 5 years ago

I'm not sure about this is really need.

misino commented 5 years ago

There are 2 parts which are solved in this PR.

  1. Current solution expects that URL to solr core is in certain shape <protocol>://<host>[<:port>]/[<rootPath>]/<core>. But what if somebody want to use solr core which is hidden behind proxy (for example on url http://example.com) ? Presented solution removes this constraint and gives more flexibility in shape of the endpoint.

  2. Solution in this PR improves a performance a little bit. It is not significant, but at least something. The URL is created only once - in the constructor. Previously it was created on each request.