Thank you Shawn 

I did what you told me. now this is my code:


import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.SolrServer;
//import org.apache.solr.client.solrj.SolrServer;
import org.apache.solr.client.solrj.SolrServerException;

import org.apache.solr.client.solrj.impl.*;

import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.common.SolrDocumentList;


import java.io.InputStream;
@Override
                        public void onClick(View v) {
                                // TODO Auto-generated method stub
                                //etxt2.setText(etxt1.getText());
                                  
                  //ALERT MESSAGE
 // Toast.makeText(getBaseContext(),"Please wait, connecting to
server.",Toast.LENGTH_LONG).show();                     
                                SolrServer solr;
                                String urlString = 
"http://localhost:8983/solr/collection1";;
                                solr = new HttpSolrServer(urlString);

                                    SolrQuery query = new SolrQuery();
                                    query.set("qt", "/select");
                                    query.set("q", "mem");
                                  
                                       QueryResponse response = null;
                                        
                                                try {
                                                        response = 
solr.query(query);
                                                        SolrDocumentList 
results = response.getResults();
                                                    for (int i = 0; i < 
results.size(); ++i) {
                                                      
//System.out.println(results.get(i));
                                                        
etxt2.setText((CharSequence) results.get(i));
                                                    }
                                                } catch (SolrServerException e) 
{
                                                        // TODO Auto-generated 
catch block
                                                        e.printStackTrace();
                                                }
                                          }            }        );   }




it gives me error that org.apache.solr.client.solrj is not found !!!!




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

Reply via email to