lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From blach <stag...@gmail.com>
Subject can't make GET request to solr in android app
Date Mon, 05 May 2014 00:22:08 GMT
Hello all.

I'm trying to make a small search engine based on android. when I'm calling
solr by this 
"http://localhost:8983/solr/collection1/select?q="+loginValue+"&wt=json&indent=true";
(loginValue is the keywork im looking for)

Its always giving me a fail message this is the code:

 try{ 

            // URLEncode user defined data

              String loginValue    =
URLEncoder.encode(etxt1.getText().toString(), "UTF-8");
       
          // Create http client object to send request to server

              HttpClient Client = new DefaultHttpClient();
              
              
           String URL =
"http://localhost:8983/solr/collection1/select?q="+loginValue+"&wt=json&indent=true";
          

          try
           {
                         String SetServerString = "";
               
                       // Create Request to server and get response
                        HttpGet httpget = new HttpGet(URL);
                        ResponseHandler<String> responseHandler = new
BasicResponseHandler();
                        SetServerString = Client.execute(httpget,
responseHandler);
              
                         // Show response on activity 

                        etxt2.setText(SetServerString);
        	  
        
        	   
            }}
          catch(Exception ex)
             {
        	  etxt2.setText("Fail!");
              }
       }
     catch(UnsupportedEncodingException ex)
      {
    	 etxt2.setText("Fail11111");
       }     
   }





any suggestion 



--
View this message in context: http://lucene.472066.n3.nabble.com/can-t-make-GET-request-to-solr-in-android-app-tp4134584.html
Sent from the Solr - User mailing list archive at Nabble.com.

Mime
View raw message