public void TestBoolQueryWithTwoCondition()
{
var query = new BoolQuery();
query.Must(new TermQuery("type", "common"));
query.Must(new TermQuery("age", "23"));
query.SetBoost(5);
var result = client.Search(index, "type" , query, 0, 5);
Assert.AreEqual(1, result.GetTotalCount());
Assert.AreEqual(1, result.GetHits().Hits.Count);
query = new BoolQuery();
query.Must(new TermQuery("type", "common"));
query.MustNot(new TermQuery("age", "23"));
query.SetBoost(5);
result = client.Search(index, "type" , query, 0, 5);
Assert.AreEqual(2, result.GetTotalCount());
Assert.AreEqual(2, result.GetHits().Hits.Count);
}