# Elasticsearch search is not working

**URL:** <https://discuss.elastic.co/t/elasticsearch-search-is-not-working/117917>\
**Category:** Elasticsearch\
**Created:** [February 1, 2018, 12:53am UTC](https://discuss.elastic.co/t/elasticsearch-search-is-not-working/117917 "2018-02-01T00:53:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![databeata](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@databeata](https://discuss.elastic.co/u/databeata)\
**Post date:** [February 1, 2018, 12:53am UTC](https://discuss.elastic.co/t/elasticsearch-search-is-not-working/117917/1 "2018-02-01T00:53:37Z")

</div>

This search returns the correct document in kibana.

`date:"18-01-29" AND time:"00:59:58,809" AND EventType:"ERROR"`

How do I search the same document in elasticsearch?

I get an error with this search.

```
curl -XGET 'ip:9200/index_name/_search?pretty' -H 'Content-Type: application/json' -d'
{
    "query": {
        "query_string": {
            "query": "(date:18-01-29) AND (EventType:ERROR) AND (time:00\:59\:58,809)"
        }
    }
}
'

"reason" : "Unrecognized character escape ':' (code 58)\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@3124698d; line: 5, column: 75]"

```

This search does not return the correct document in elasticsearch.

```
curl -XGET 'ip:9200/index_name/_search?pretty' -H 'Content-Type: application/json' -d'
{
  "query": {
    "bool": {
      "must": [
        { "match": { "date": "18-01-29" }},
        { "match": { "time": "00:59:58,809" }},
        { "match": { "EventType": "ERROR" }}
      ]
    }
  }
}
'
```

---

<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:** [February 1, 2018, 7:26am UTC](https://discuss.elastic.co/t/elasticsearch-search-is-not-working/117917/2 "2018-02-01T07:26:01Z")

</div>

Please format your code using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and not the citation button. It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

Please edit your post.

---

<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:** [February 1, 2018, 7:27am UTC](https://discuss.elastic.co/t/elasticsearch-search-is-not-working/117917/3 "2018-02-01T07:27:51Z")

</div>

I can not reproduce your issue. The query is good on my end. I'd say that you have somewhere a bad character.  
I tried it in Kibana Console.

---

<div class="post-metadata">

**Author:** ![johtani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johtani/32/44956_2.png) [@johtani](https://discuss.elastic.co/u/johtani)\
**Post date:** [February 1, 2018, 8:51am UTC](https://discuss.elastic.co/t/elasticsearch-search-is-not-working/117917/4 "2018-02-01T08:51:27Z")

</div>

How about this?

```auto
curl -XGET 'ip:9200/index_name/_search?pretty' -H 'Content-Type: application/json' -d'
{
"query": {
"query_string": {
"query": "(date:18-01-29) AND (EventType:ERROR) AND (time:\"00:59:58,809\")"
}
}
}
'

```

Or

```auto
curl -XGET "http://ip:9200/index_name/_search?pretty" -H 'Content-Type: application/json' -d'
{
  "query": {
    "query_string": {
      "query": "(date:18-01-29) AND (EventType:ERROR) AND (time:00\\:59\\:58,809)"
      }
    }
}'

```

See Reserved Character: [https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#\_reserved\_characters](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#_reserved_characters)

I'm not sure why your 2nd query doesn't work, need more example data...

---

<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:** [March 1, 2018, 8:51am UTC](https://discuss.elastic.co/t/elasticsearch-search-is-not-working/117917/5 "2018-03-01T08:51:28Z")

</div>

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