Exemple #1
0
        public async Task TestSolrCloud()
        {
            using (var provider = new SolrCloudStateProvider("10.26.11.30:9983"))
            {
                await CloudStartup.InitAsync <TestEntity>(provider);

                TestRoutine();
            }
        }
Exemple #2
0
        public async Task AddRemoveTest()
        {
            const int    DocumentCount       = 1000;
            const string ZooKeeperConnection = "10.26.11.30:9983";
            await CloudStartup.InitAsync <TestEntity>(new SolrCloudStateProvider(ZooKeeperConnection));

            var operations = CloudStartup.Container.GetInstance <ISolrOperations <TestEntity> >();

            operations.Delete(SolrQuery.All);
            operations.Commit();

            //// send one by one to test sharding distribution and sending to leaders only
            foreach (var ent in GenerateTestData(DocumentCount))
            {
                operations.Add(ent);
            }
            operations.Commit();

            var results = operations.Query(SolrQuery.All);

            Assert.Equal(DocumentCount, results.Count);
        }