I need to know the performance between EmbeddedSolrServer and CommonsHttpSolrServer.
EmbeddedSolrServer:
File home = new File("C:\\workspace\\SolrWithMultipleCore\\solr");
File f = new File( home, "solr.xml" );
CoreContainer container = new CoreContainer();
container.load( "C:\\workspace\\SolrMultipleCore\\solr", f );
EmbeddedSolrServer server = new EmbeddedSolrServer( container,"core1");
EmbeddedSolrServer server1 = new EmbeddedSolrServer( container,"core2");
String query=params.getParams("q");
String query1=params.getParams("q1");
SolrQuery solrquery=new SolrQuery(query);
QueryResponse rsp1 = server.query(solrquery);
QueryResponse rsp2 = server1.query(solrquery);
CommonsHttpSolrServer:
SolrServer httpServer = new CommonsHttpSolrServer(url);
QueryResponse rsp1=httpServer.query(q);
SolrServer httpServer1 = new CommonsHttpSolrServer(url1);
QueryResponse rsp2=httpServer1.query(q1);
Which is best EmbeddedSolrServer or CommonsHttpSolrServer? the two core i meantion has different schema. I need to know what is MultiThreadedHttpConnectionManager.
Embedded is obviously faster because it doesn't have any HTTP or serialization overhead. That doesn't mean you should always use embedded. See the EmbeddedSolr wiki page.
About MultiThreadedHttpConnectionManager, the CommonHttpSolrServer javadocs explain:
The connection manager for the client should be a MultiThreadedHttpConnectionManager if this client is being reused across SolrServer instances, or of multiple threads will use this SolrServer.