# Searching fields for specific values

**URL:** <https://discuss.elastic.co/t/searching-fields-for-specific-values/64004>\
**Category:** Elasticsearch\
**Created:** [October 26, 2016, 12:49pm UTC](https://discuss.elastic.co/t/searching-fields-for-specific-values/64004 "2016-10-26T12:49:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![susrich0810](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@susrich0810](https://discuss.elastic.co/u/susrich0810)\
**Post date:** [October 26, 2016, 12:49pm UTC](https://discuss.elastic.co/t/searching-fields-for-specific-values/64004/1 "2016-10-26T12:49:05Z")

</div>

I'm trying to search the fields of our indices for a specific value. The field I'm checking is 'topic', and I want to find indices that have a value that matches a search string. So, for example, how can I construct a curl command to search to find a 'topic' field that contains the value 'Hello World'? Also, how could I do something similar with a short phrase, searching all of the message fields within an index?

I've tried numerous things from your API docs, and no luck, so any assistance would be appreciated!

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [October 31, 2016, 3:29pm UTC](https://discuss.elastic.co/t/searching-fields-for-specific-values/64004/2 "2016-10-31T15:29:00Z")

</div>

```auto
curl -XPOST localhost:9200/index/_search -d'{
  "query": {
    "match": {
      "topic": "hello world"
    }
  }
}'

```

That searches in a `topic` field in the index named `index` that contains the words `hello` and `world` in any order with any proximity to one another. You could also do this:

```auto
curl -XPOST localhost:9200/index/_search -d'{
  "query": {
    "match_phrase": {
      "topic": "hello world"
    }
  }
}'

```

That searches in a `topic` field in the index named `index` that contains the words `hello` and `world` in that order without any words between them.

Here are some important docs to read:  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis.html)  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.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:** [July 5, 2017, 10:08pm UTC](https://discuss.elastic.co/t/searching-fields-for-specific-values/64004/3 "2017-07-05T22:08:13Z")

</div>


