takezoe / solr-scala-client

Solr Client for Scala
Apache License 2.0
91 stars 43 forks source link

Is there a reason SolrClient.server has to be private? #49

Closed jeffdyke closed 5 years ago

jeffdyke commented 6 years ago

Being that it is private means you have to write extra code to get simple things like server.ping While I find this client very useful for my needs as they are quite simple, being able to access the underlying client would be helpful and stop you from writing additional code or interacting with both this library and then the raw java library.

Oh, i'm happy to open a PR, but only if it will be accepted. Thanks

takezoe commented 6 years ago

My intention was hiding the server field from application code because there is a possibility to replace it with other implementation. For example, AsyncSolrClient uses OkHttp instead of SolrJ. I didn't think it will be happen immediately and in fact, it hasn't been happened until now. :-P

Anyway, it's possible to supply a server instance through factory, so I think if we have to touch server directly, we can do it by creating our own factory. How do you think about this approach?

jeffdyke commented 6 years ago

First off, good point, i didn't realize that. i was able to make a simple work around for ping but your idea about creating your own factory seems like a good approach given your first point.