示例#1
0
        public void Alias()
        {
            var coreName      = "core-new";
            var solrCoreAdmin = new SolrCoreAdmin(new SolrConnection(solrUrl), GetHeaderParser(), GetStatusResponseParser());

            var aliasResponseHeader = solrCoreAdmin.Alias(coreName, "corefoo");

            Assert.AreEqual(aliasResponseHeader.Status, 0);
        }
示例#2
0
        public void Alias()
        {
            var istanceDir    = DirectoryUtility.GetCoreIstanceDirectory(CoreNew);
            var solrCoreAdmin = new SolrCoreAdmin(new SolrConnection(SolrUrl), GetHeaderParser(), GetStatusResponseParser());
            var status        = solrCoreAdmin.Status(CoreNew);

            if (string.IsNullOrEmpty(status.Name))
            {
                solrCoreAdmin.Create(CoreNew, istanceDir);
            }


            var aliasResponseHeader = solrCoreAdmin.Alias(CoreNew, "corefoo");

            Assert.AreEqual(aliasResponseHeader.Status, 0);
        }