apache - Issues performing a query to Solr via HttpClient using Solr 3.5 and HttpClient 4.2 -


I am trying to use HTTP client to my local solar server and I did not know why the parameter Receive Call

My code is:

  HttpRequestBase request = New HttpGet ("http: // localhost: 8080 / solr / Select "); HTTP Parameters Parameters = new basic HTTPPARM (); Params.setParameter ("q", query); Params.setParameter ("Start", String.valueOf (Start)); Params.setParameter ("Rows", String.valueOf (Rows)); Request.setParams (parameter); HTTP Client HTTP Client = New DefaultHttpClient (); HTTPReponse response = httpClient.execute (request); HttpEntity unit = response.getEntity (); InputStream = entity.getContent (); Return StringsOffream Conversion (IS); // 500 error, NullPointerException, the response is empty   

I tried to try to get back several things and tried to figure out where the problem was, finally I know It's gone that I was only returning http: // localhost: 8080 / solr / select

return request.getURI (). () .to string ();

I do not understand why the parameters are not being added. If I do

request back .getQuery ();

I could not find anything ... any thoughts? Thanks for the help in advance!

From what I have seen you are not able to associate your paeans.

So, instead of creating a new HTTP Parameters object and connecting with the request, can you try the following approach?

httpCclient.getParams (). SetParameter ("q", query "); ....

Comments