Ok thanks, that's an idea :-)
Maybe we should suggest to have a method in CommonsHttpSolrServer that is
returning Solr's version...

Marc.

On Wed, Apr 6, 2011 at 2:58 PM, Erick Erickson <erickerick...@gmail.com>wrote:

> The only way I know of (and it's a little, well, a lot arcane)
> is to ping the admin/system handler. As it happens, I just
> had to do something like this.  This uses apache commons
> http client 3X, NOT the most recent FWIW...
> The URl can be admin/<see solrconfig.xml>
>
> I'd really like to find out that there's an easier way. This brings
> back everything on the "admin/info" page.
>
>  public static void main(String[] args) {
>    HttpMethod method = new GetMethod("
> http://localhost:8983/solr/admin/system";);
>    try {
>      CommonsHttpSolrServer server = new CommonsHttpSolrServer("
> http://localhost:8888";);
>      HttpClient client = server.getHttpClient();
>
>      int statusCode = client.executeMethod(method);
>      // Really, you'd want to do something here.
>      byte[] responseBody = method.getResponseBody();
>      System.out.println(new String(responseBody));
>
>    } catch (Exception e) {
>      e.printStackTrace();
>    } finally {
>      // Release the connection.
>      method.releaseConnection();
>    }
>  }
>
> On Tue, Apr 5, 2011 at 5:46 AM, Marc SCHNEIDER
> <marc.schneide...@gmail.com>wrote:
>
> > Hi,
> >
> > I'm wondering how to find out which version of Solr is currently running
> > using the Solrj library?
> >
> > Thanks,
> > Marc.
> >
>

Reply via email to