It's been working for me. One thing to look out for might be the url you're using in SolrUtil.getSolrServer()? The url you use for reindexing won't be the same as the one you use to swap cores. Make sure it's using "admin/cores" and not "production/admin/cores" or "reindex/admin/cores".
Sorry if this is the obvious first thing you looked at already. :) It's the first thing that came to my mind. Tim On Fri, Dec 3, 2010 at 12:45 PM, Will Milspec <will.mils...@gmail.com> wrote: > hi all, > > Does solrj support "swapping cores"? > > One of our developers had initially tried swapping solr cores (e.g. core0 > and core1) using the solrj api, but it failed. (don't have the exact error) > He susequently replaced the call with straight http (i.e. http client). > > Unfortunately I don't have the exact error in front of me... > > Solrj code: > > CoreAdminRequest car = new CoreAdminRequest(); > car.setCoreName("production"); > car.setOtherCoreName("reindex"); > car.setAction(CoreAdminParams.CoreAdminAction.SWAP); > > SolrServer solrServer = SolrUtil.getSolrServer(); > car.process(solrServer); > solrServer.commit(); > > Finally, can someone comment on the solrj javadoc on CoreAdminRequest: > * This class is experimental and subject to change. > > thanks, > > will >