I am thinking that how do I change the following code, so I can store the query from Solr
into an ArrayList
?
public static void main(String[] args) throws MalformedURLException, SolrServerException {
HttpSolrServer solr = new HttpSolrServer("http://localhost:8983/solr");
Scanner sc = new Scanner(System.in);
System.out.println("What are you looking for: ")
String look = sc.nextLine();
SolrQuery query = new SolrQuery();
query.setQuery(look);
query.setFields("id");
query.setStart(0);
QueryResponse response = solr.query(query);
SolrDocumentList results = response.getResults();
for (int i = 0; i < results.size(); ++i) {
System.out.println(results.get(i));
}
}