# Search query doesn't return document

**URL:** <https://discuss.elastic.co/t/search-query-doesnt-return-document/32933>\
**Category:** Elasticsearch\
**Created:** [October 25, 2015, 12:13pm UTC](https://discuss.elastic.co/t/search-query-doesnt-return-document/32933 "2015-10-25T12:13:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Grauen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grauen/32/88529_2.png) [@Grauen](https://discuss.elastic.co/u/Grauen)\
**Post date:** [October 25, 2015, 12:13pm UTC](https://discuss.elastic.co/t/search-query-doesnt-return-document/32933/1 "2015-10-25T12:13:31Z")

</div>

I'm using ela 2.0.0-rc1.

When I try to use the search query, to retrieve documents, elasticsearch will return

```
{
   "_index": "myindex",
   "_type": "_all",
   "_id": "_search'",
   "found": false
}

```

This is how I add the document

```
PUT myindex/game/3
               {
               "title":"Super Mario 3D World",
               "publisher":"Nintendo",
               "developer":"Nintendo",
               "publishDate":"20132911"
               }

GET lpc/game/3
{
   "_index": "myindex",
   "_type": "game",
   "_id": "3",
   "_version": 2,
   "found": true,
   "_source": {
      "title": "Super Mario 3D World",
      "publisher": "Nintendo",
      "developer": "Nintendo",
      "publishDate": "20132911"
   }
}

```

My search:

```
GET /myindex/_all/_search'?q=publisher:Nintendo'
{
   "_index": "lpc",
   "_type": "_all",
   "_id": "_search'",
   "found": false
}

```

Whats wrong with my search? This also returns an empty result, when I replace **\_all** by **game**

---

<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:** [October 25, 2015, 12:42pm UTC](https://discuss.elastic.co/t/search-query-doesnt-return-document/32933/2 "2015-10-25T12:42:21Z")

</div>

Lpc ? Myindex ? You are mixing things here.

Don't use \_all as the type but just search with index/\_search

---

<div class="post-metadata">

**Author:** ![Grauen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grauen/32/88529_2.png) [@Grauen](https://discuss.elastic.co/u/Grauen)\
**Post date:** [October 25, 2015, 1:44pm UTC](https://discuss.elastic.co/t/search-query-doesnt-return-document/32933/3 "2015-10-25T13:44:36Z")

</div>

my mistake. the index is myindex, not lpc.  
Like I said, the document can't be found, even if I search by index/\_search

```
GET /myindex/_search?q=publisher:Nintendo'

  {
   "took": 1,
   "timed_out": false,
   "_shards": {
      "total": 5,
      "successful": 5,
      "failed": 0
   },
   "hits": {
      "total": 0,
      "max_score": null,
      "hits": []
   }
}

```

EDIT: I also can't find any results in this case:

```
GET /myindex/_search?q=*:*'
{
   "took": 180,
   "timed_out": false,
   "_shards": {
      "total": 5,
      "successful": 5,
      "failed": 0
   },
   "hits": {
      "total": 0,
      "max_score": null,
      "hits": []
   }
}

```

EDIT:

SOLVED. I ignored my own field mapping.

---

<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:42pm UTC](https://discuss.elastic.co/t/search-query-doesnt-return-document/32933/4 "2017-07-05T23:42:46Z")

</div>


