# Elasticsearch - how to curl what I need from localhost:9200?

**URL:** <https://discuss.elastic.co/t/elasticsearch-how-to-curl-what-i-need-from-localhost-9200/170798>\
**Category:** Elasticsearch\
**Created:** [March 4, 2019, 9:33pm UTC](https://discuss.elastic.co/t/elasticsearch-how-to-curl-what-i-need-from-localhost-9200/170798 "2019-03-04T21:33:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmw417](https://avatars.discourse-cdn.com/v4/letter/b/c2a13f/32.png) [@bmw417](https://discuss.elastic.co/u/bmw417)\
**Post date:** [March 4, 2019, 9:33pm UTC](https://discuss.elastic.co/t/elasticsearch-how-to-curl-what-i-need-from-localhost-9200/170798/1 "2019-03-04T21:33:19Z")

</div>

Here's a link to my SO question no one answered:  
[https://stackoverflow.com/questions/54962586/elasticsearch-curl-error-when-trying-to-search](https://stackoverflow.com/questions/54962586/elasticsearch-curl-error-when-trying-to-search)

To reiterate from that question, I have an index called threat-reports, and one of the tags is Title, which contains something along the lines of CVE-1999-0001.json, CVE-1999-0002.json, etc. I entered in a query in Kibana to match only the Title CVE-1999-0003.json and Kibana came up with this query:

```
{
  "query": {
    "match": {
      "Title": {
        "query": "CVE-1999-0003.json",
        "type": "phrase"
      }
    }
  }
}

```

However, when I try and convert that to a curl command (since I can't find a place in Kibana to do so), my command looks like this (which seems to work for other things just fine):

```
curl -X GET "localhost:9200/_search?pretty" -H 'Content-Type: application/json' -d '
{
  "query": {
    "match": {
      "Title": {
        "query": "CVE-1999-0003.json",
        "type": "phrase"
      }
    } 
  }
}
'

```

But curl returns

```
{
  "error" : {
    "root_cause" : [
      {
        "type" : "parsing_exception",
        "reason" : "[match] query does not support [type]",
        "line" : 7,
        "col" : 17
      }
    ],
    "type" : "parsing_exception",
    "reason" : "[match] query does not support [type]",
    "line" : 7,
    "col" : 17
  },
  "status" : 400
}

```

Does anyone know how to fix this? I really need to be able to index my titles so that I don't add a duplicate entry in the database.

---

<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:** [March 4, 2019, 10:07pm UTC](https://discuss.elastic.co/t/elasticsearch-how-to-curl-what-i-need-from-localhost-9200/170798/2 "2019-03-04T22:07:39Z")

</div>

May be look at [https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query-phrase.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query-phrase.html)

---

<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:** [April 1, 2019, 10:07pm UTC](https://discuss.elastic.co/t/elasticsearch-how-to-curl-what-i-need-from-localhost-9200/170798/3 "2019-04-01T22:07:56Z")

</div>

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