[ https://issues.apache.org/jira/browse/SOLR-457?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
patrick o'leary updated SOLR-457: --------------------------------- Attachment: multithreaded-solrj.patch Provides a multi-threaded implementation of CommonsHttpSolrServer for use with distributed searching. Example Usage : {code} MultiThreadedHttpSolrServer mtserver = new MultiThreadedHttpSolrServer("http://"+shards[0]); boolean first = true; ModifiableSolrParams params = sreq.params; params.remove("wt"); // use default response format (or let SolrJ select) params.remove("version"); params.remove("shards"); // not a top-level request params.remove("indent"); params.remove("echoParams"); params.set("isShard", true); // a sub (shard) request for (String shard : shards) { String url = "http://" + shard; if (! first){ mtserver.addSolrServer("http://"+shard); } else { first = false; } } // process all the shards // and retrive the responses QueryResponse[] responses = mtserver.process(params); int sz = responses.length; // Responses are maintained in an array matching // the order they were added to the MultiThreadedSolrServer for (int i = 0; i < sz; i++){ ShardResponse srsp = new ShardResponse(); srsp.req = sreq; srsp.shard = shards[i]; srsp.rsp = responses[i]; sreq.responses.add(srsp); } {code} > A multi threaded implementation for solrJ > ----------------------------------------- > > Key: SOLR-457 > URL: https://issues.apache.org/jira/browse/SOLR-457 > Project: Solr > Issue Type: New Feature > Components: clients - java > Affects Versions: 1.3 > Reporter: patrick o'leary > Priority: Minor > Fix For: 1.3 > > Attachments: multithreaded-solrj.patch > > > Provide a multi threaded implementation of CommonsHttpSolrServer > For usage with distributed searching in solr-303 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.