Tests.QueryDSLTests.TestTypeFilter C# (CSharp) Method

TestTypeFilter() private method

private TestTypeFilter ( ) : void
return void
        public void TestTypeFilter()
        {
            string testForShard = "test_for_shard_123";
            client.CreateIndex(testForShard, new IndexSetting(6, 0));
            for (int i = 0; i < 10; i++)
            {
                Dictionary<string, object> dict = new Dictionary<string, object>();
                dict["a"] = i;
                client.Index(testForShard, "type1", i.ToString(), dict);
            }

            for (int i = 0; i < 10; i++)
            {
                Dictionary<string, object> dict = new Dictionary<string, object>();
                dict["a"] = i;
                client.Index(testForShard, "type2", i.ToString(), dict);
            }

            Thread.Sleep(1000);
            var constantScoreQuery = new ConstantScoreQuery(new TypeFilter("type2"));
            var result = client.Search(testForShard, null, constantScoreQuery, 0, 25);
            Assert.AreEqual(10, result.GetTotalCount());
            Assert.AreEqual(10, result.GetHits().Hits.Count);

            client.DeleteIndex(testForShard);
        }