# Elastic Search Request Body search by \_type

**URL:** <https://discuss.elastic.co/t/elastic-search-request-body-search-by--type/28698>\
**Category:** Elasticsearch\
**Created:** [September 4, 2015, 6:24pm UTC](https://discuss.elastic.co/t/elastic-search-request-body-search-by--type/28698 "2015-09-04T18:24:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![inderjeet26](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inderjeet26/32/3870_2.png) [@inderjeet26](https://discuss.elastic.co/u/inderjeet26)\
**Post date:** [September 4, 2015, 6:24pm UTC](https://discuss.elastic.co/t/elastic-search-request-body-search-by--type/28698/1 "2015-09-04T18:24:50Z")

</div>

I am doing a query like so:

```
curl -XGET localhost:9200/logstash*/_search
{
  "query": {
    "match": {
      "_type": "xxx"
    }
  }
}

```

I have deleted all the documents of type xxx, by `curl -XDELETE localhost:9200/logstash*/xxx`  
but the above query is still giving me results in elasticsearch.

But if I do search with this: `curl -XGET localhost:9200/logstash*/xxx/_search`, without request body, there are no results.

Could yo pls help in what is going on here?

---

<div class="post-metadata">

**Author:** ![inderjeet26](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inderjeet26/32/3870_2.png) [@inderjeet26](https://discuss.elastic.co/u/inderjeet26)\
**Post date:** [September 4, 2015, 6:51pm UTC](https://discuss.elastic.co/t/elastic-search-request-body-search-by--type/28698/2 "2015-09-04T18:51:08Z")

</div>

Found this thread [Should filtering by type and type-specific search URL return different results?](https://discuss.elastic.co/t/should-filtering-by-type-and-type-specific-search-url-return-different-results/7008) but does not really help

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [September 5, 2015, 3:01am UTC](https://discuss.elastic.co/t/elastic-search-request-body-search-by--type/28698/3 "2015-09-05T03:01:52Z")

</div>

What kind of results are you getting? What type do they have? Do they have a field named `_type` that doesn't match their actual type but contains `xxx`?

---

<div class="post-metadata">

**Author:** ![inderjeet26](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inderjeet26/32/3870_2.png) [@inderjeet26](https://discuss.elastic.co/u/inderjeet26)\
**Post date:** [September 5, 2015, 5:52pm UTC](https://discuss.elastic.co/t/elastic-search-request-body-search-by--type/28698/4 "2015-09-05T17:52:08Z")

</div>

Hello,

I am getting documents of \_type:"xxx" in the logstash indexes, which I already deleted by using command curl -XDELETE localhost:9200/logstash\*/xxx.

The \_type and type field for all these documents is "xxx". i.e same. Hope this helps.

Thanks

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [September 5, 2015, 7:13pm UTC](https://discuss.elastic.co/t/elastic-search-request-body-search-by--type/28698/5 "2015-09-05T19:13:11Z")

</div>

Hmm, this is really puzzling. The only idea that I had is that the `_type` field inside the record doesn't match the real type of the record and it confuses the search engine. If this is not the case, it would be great if you could show how to recreate this problem. Please see [https://www.elastic.co/help](https://www.elastic.co/help) for some guildlines on how to post a recreation.

---

<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:** [July 5, 2017, 11:51pm UTC](https://discuss.elastic.co/t/elastic-search-request-body-search-by--type/28698/6 "2017-07-05T23:51:58Z")

</div>


