I am using SolrJ API 4.8 to index rich documents to solr. But i want to index these documents asynchronously. The function that I made send documents synchronously but i don't know how to change it to make it asynchronously. Any idea?
Function: public Boolean indexDocument(HttpSolrServer server, String PathFile, InputReader external) { ContentStreamUpdateRequest up = new ContentStreamUpdateRequest("/update/extract"); try { up.addFile(new File(PathFile), "text"); } catch (IOException e) { Logger.getLogger(ANOIndexer.class.getName()).log(Level.SEVERE, null, e); return false; } up.setAction(AbstractUpdateRequest.ACTION.COMMIT, true, true); try { server.request(up); } catch (SolrServerException e) { Logger.getLogger(ANOIndexer.class.getName()).log(Level.SEVERE, null, e); return false; } catch (IOException e) { Logger.getLogger(ANOIndexer.class.getName()).log(Level.SEVERE, null, e); return false; } return true; } Solr server: version 4.8.