Search query doesn't return document


(Grauen) #1

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


(David Pilato) #2

Lpc ? Myindex ? You are mixing things here.

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


(Grauen) #3

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.


(system) #4