1

I have index with mappings type like this:

{
  "mappings":{
    "logs_june":{
      "_timestamp":{
        "enabled":"true"
      },
      "properties":{
        "logdate":{
          "type":"date",
          "format":"dd/MM/yyyy HH:mm:ss"
        }
      }
    }
  }
}

And there is many doc in it(enter image description here). When I try to get the docs with search query below it throws SearchPhaseExecutionException .. all shards failed.. bla bla What is it problem that I must fix ?

$queryFilter = '{
                "query":{
                    "filtered":{
                        "query":{
                            "match_all":{}
                        },
                        "filter":{
                            "range":{
                                "logdate":{
                                    "gte":"00/00/2014 00:00:00  "
                                }
                            }
                        }
                    }
                }
            }';
            $params['body'] = $queryFilter;
            $params['index'] = 'accesslog';
            $params['size'] = 1000;
            $query = $elasticSearch->search($params);
  • 1
    can u post the complete error message i.e SearchPhaseExecutionException etc – keety Jul 25 '15 at 22:05
  • @keety Hi, issue solved but another thread I need help ini can you check it: any help appreciated Thank you. http://stackoverflow.com/questions/31635828/python-elasticsearch-client-set-mappings-during-create-index –  Jul 26 '15 at 11:50

1 Answers1

1

I'm pretty certain your SearchPhaseExecutionException tells you something along the lines of

IllegalFieldValueException[Cannot parse "00/00/2014 00:00:00": Value 0 for monthOfYear must be in the range [1,12]]; 

Try using "01/01/2014 00:00:00" in your range filter instead, i.e. with a valid day and month instead of 00, which is not valid. Also make sure to remove the spaces at the end, as it will also cause an error during the date parsing.

Val
  • 207,596
  • 13
  • 358
  • 360
  • Hi, I know its not the way right but there is no many people able to help such as this problems.. so can you check this also: http://stackoverflow.com/questions/31635828/python-elasticsearch-client-set-mappings-during-create-index Thank you. –  Jul 26 '15 at 11:49