Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
4.0-BETA
Description
With one instance of CloudSolrServer I can't add documents to multiple collections, for example:
@Test public void shouldSendToSecondCore() throws Exception { //given try { CloudSolrServer server = new CloudSolrServer("localhost:9983"); UpdateRequest commit1 = new UpdateRequest(); commit1.setAction(ACTION.COMMIT, true, true); commit1.setParam("collection", "collection1"); //this commit is bug's cause commit1.process(server); SolrInputDocument doc = new SolrInputDocument(); doc.addField("id", "id"); doc.addField("name", "name"); UpdateRequest update2 = new UpdateRequest(); update2.setParam("collection", "collection2"); update2.add(doc); update2.process(server); UpdateRequest commit2 = new UpdateRequest(); commit2.setAction(ACTION.COMMIT, true, true); commit2.setParam("collection", "collection2"); commit2.process(server); SolrQuery q1 = new SolrQuery("id:id"); q1.set("collection", "collection1"); SolrQuery q2 = new SolrQuery("id:id"); q2.set("collection", "collection2"); //when QueryResponse resp1 = server.query(q1); QueryResponse resp2 = server.query(q2); //then Assert.assertEquals(0L, resp1.getResults().getNumFound()); Assert.assertEquals(1L, resp2.getResults().getNumFound()); } finally { CloudSolrServer server1 = new CloudSolrServer("localhost:9983"); server1.setDefaultCollection("collection1"); server1.deleteByQuery("id:id"); server1.commit(true, true); CloudSolrServer server2 = new CloudSolrServer("localhost:9983"); server2.setDefaultCollection("collection2"); server2.deleteByQuery("id:id"); server2.commit(true, true); } }
Second update goes to first collection.
Attachments
Attachments
Issue Links
- is related to
-
SOLR-4046 An instance of CloudSolrServer is not able to handle consecutive request on different collections o.a.
- Resolved