from elasticsearch_dsl.search import Search

def test_count_all(data_client):
    s = Search(using=data_client).index('git')
    assert 53 == s.count()

def test_count_type(data_client):
    s = Search(using=data_client).index('git').doc_type('repos')
    assert 1 == s.count()

def test_count_filter(data_client):
    s = Search(using=data_client).index('git').filter('missing', field='parent_shas')
    # initial commit + repo document
    assert 2 == s.count()


@@ -446,20 +446,314 @@
 ert 2 == s.count()%0A%0A
+def test_search_type_count(data_client):%0A    s = Search(using=data_client, index='git')%0A    s.aggs.bucket('per_type', 'terms', field='_type')%0A    s = s.params(search_type='count')%0A    result = s.execute()%0A%0A    assert %5B%5D == result.hits%0A    assert 2 == len(result.aggregations.per_type.buckets)%0A%0A

Make sure search_type=count works