# No search type for \[count\]

**URL:** <https://discuss.elastic.co/t/no-search-type-for-count/101994>\
**Category:** Elasticsearch\
**Created:** [September 27, 2017, 2:08pm UTC](https://discuss.elastic.co/t/no-search-type-for-count/101994 "2017-09-27T14:08:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomer](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@tomer](https://discuss.elastic.co/u/tomer)\
**Post date:** [September 27, 2017, 2:08pm UTC](https://discuss.elastic.co/t/no-search-type-for-count/101994/1 "2017-09-27T14:08:21Z")

</div>

Hi,

I am making a query with the following header:

> "POST /test/\_search?search\_type=count"

as I saw in [this question](https://stackoverflow.com/questions/29016271/how-to-get-latest-values-for-each-group-with-an-elasticsearch-query), but it results with the following exception:

> {  
> "error": {  
> "root\_cause": [  
> {  
> "type": "illegal\_argument\_exception",  
> "reason": "No search type for [count]"  
> }  
> ],  
> "type": "illegal\_argument\_exception",  
> "reason": "No search type for [count]"  
> },  
> "status": 400  
> }

How can this be?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 27, 2017, 2:26pm UTC](https://discuss.elastic.co/t/no-search-type-for-count/101994/2 "2017-09-27T14:26:31Z")

</div>

This option has been removed.

Just set size to 0

---

<div class="post-metadata">

**Author:** ![tomer](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@tomer](https://discuss.elastic.co/u/tomer)\
**Post date:** [September 27, 2017, 2:33pm UTC](https://discuss.elastic.co/t/no-search-type-for-count/101994/3 "2017-09-27T14:33:28Z")

</div>

Hi,  
Which size do you mean?

If it is the size that I think it is then I get from the following query (you can see that size = 0)

```
POST /filebeat-*/log/_search?scroll=1m&pretty
{
    "size": 0,
   "query": {
    
   "bool":{ 

      "must": [
        
		{ "match": {"concatenated": "FALSE"}},
        { "range": 
          { 
            "delay": 
              {
                "gte": 0,
                "lt": 3
              } 
          }
        },
        { "range": 
          { 
            "eventTimestamp.raw": 
              {
                "gte" : "now-99999m/m",
                "lt" : "now/m"
              } 
          }
        }
      ]
   }
  }
}

```

The result:

> {  
> "\_scroll\_id": "DnF1ZXJ5VGhlbkZldGNoAgAAAAAAABTYFjFZR190RHl2VFotWTBfTHdNYUVLcVEAAAAAAAAU2RYxWUdfdER5dlRaLVkwX0x3TWFFS3FR",  
> "took": 6,  
> "timed\_out": false,  
> "\_shards": {  
> "total": 2,  
> "successful": 2,  
> "failed": 0  
> },  
> "hits": {  
> "total": 19,  
> "max\_score": 0,  
> "hits":   
> }  
> }

Basicly it says the amount of logs that I want you to show me is 0, no?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 27, 2017, 2:49pm UTC](https://discuss.elastic.co/t/no-search-type-for-count/101994/4 "2017-09-27T14:49:31Z")

</div>

Why using scroll here?

The response object gives you 19 hits which is basically a count.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 25, 2017, 2:49pm UTC](https://discuss.elastic.co/t/no-search-type-for-count/101994/5 "2017-10-25T14:49:52Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
