lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alessandro Benedetti <>
Subject [Solr Schema API] SolrJ Access
Date Tue, 08 Jul 2014 09:53:54 GMT
Hi guys,
wondering if there is any proper way to access Schema API via Solrj.

Of course is possible to reach them in Java with a specific Http Request,
but in this way, using SolrCloud for example we become coupled to one
specific instance ( and we don't want) .

Code Example :

            HttpResponse httpResponse;
>             String url=this.solrBase+"/"+core+ SCHEMA_SOLR_FIELDS_ENDPOINT
> +fieldName;
>             HttpPut httpPut = new HttpPut(url);
>             StringEntity entity = new StringEntity(
>                     "{\"type\":\"text_general\",\"stored\":\"true\"}" ,
>                     ContentType.APPLICATION_JSON);
>              httpPut.setEntity( entity );
>              HttpClient client=new DefaultHttpClient();
>              response = client.execute(httpPut);

Any suggestion ?
In my opinion should be interesting to have some auxiliary method in
SolrServer if it's not there yet.



Benedetti Alessandro
Visiting card :

"Tyger, tyger burning bright
In the forests of the night,
What immortal hand or eye
Could frame thy fearful symmetry?"

William Blake - Songs of Experience -1794 England

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message