lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shawn Heisey <>
Subject Re: SOLR retrieve data using URL
Date Wed, 04 Feb 2015 05:29:52 GMT
On 2/2/2015 11:57 AM, mathewvino wrote:
> I am using solrj API to make call to Solr Server with the data that I am
> looking for. Basically I am using 
> solrj api as below to get the data. Everything is working as expected
> HttpSolrServer solr = new
> HttpSolrServer("http://server:8983/solr/collection1");
> SolrQuery query = new SolrQuery("*:*");
> query.setFacet(true).addFacetField("PLS_SURVY_SURVY_STATUS_MAP")
> Is there any API I can use the complete URL to get the data like below
> HttpSolrServer solr = new
> HttpSolrServer("http://server:8983/solr/collection1/select?q=*%3A*&wt=json&indent=true&facet=true&facet.field=PLS_SURVY_SURVY_LANG_CHOICE_MAP")
> I would like to pass the complete url to get the data insted of using solrj
> query api.

The entire point of using SolrJ is so that you don't have to create the
entire request URL yourself, and you don't have to parse the result from
xml/json/binary into Java objects.  SolrJ does all that for you,
allowing you to write Java code that is easy to read and understand.
I've written code (in Perl) that constructs the entire URL, and I much
prefer SolrJ code.

You can always use HttpClient directly, or possibly another HTTP API in
a completely different programming language.  You will need to handle
parsing of the result yourself, though.

It might be possible to dive deeply into the underlying SolrJ APIs and
write code that will get you the results you want ... but if you do
this, you are ignoring many man-hours of work that have been already
done for you, work that has been battle-tested and is known to be solid.


View raw message