# Can't get status 200

**URL:** <https://discuss.elastic.co/t/cant-get-status-200/76727>\
**Category:** Elasticsearch\
**Created:** [February 28, 2017, 7:03am UTC](https://discuss.elastic.co/t/cant-get-status-200/76727 "2017-02-28T07:03:44Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![sumo7](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@sumo7](https://discuss.elastic.co/u/sumo7)\
**Post date:** [March 1, 2017, 2:35am UTC](https://discuss.elastic.co/t/cant-get-status-200/76727/23 "2017-03-01T02:35:29Z")

</div>

I installed elasticsearch 5.2.2 on my web server hoping that my problem would be solved but got the same results as 5.0.2.  
I can store the data into elasticsearch 5.2.2 but can't get the data and it returns status code 0.  
But at least I found out that I can use 5.2.2 with current Javascript API.

---

<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 1, 2017, 3:44am UTC](https://discuss.elastic.co/t/cant-get-status-200/76727/24 "2017-03-01T03:44:45Z")

</div>

Can you run a simple curl command to run a \_search query for example?

Did you say at some point that you have a nginx layer?

---

<div class="post-metadata">

**Author:** ![sumo7](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@sumo7](https://discuss.elastic.co/u/sumo7)\
**Post date:** [March 1, 2017, 4:08am UTC](https://discuss.elastic.co/t/cant-get-status-200/76727/25 "2017-03-01T04:08:05Z")

</div>

Yes I can.

```
curl -XGET 'http://127.31.18.8:9200/users/_search/?pretty'
{
  "took" : 1,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "failed" : 0
  },
  "hits" : {
    "total" : 1,
    "max_score" : 1.0,
    "hits" : [
      {
        "_index" : "users",
        "_type" : "user",
        "_id" : "John",
        "_score" : 1.0,
        "_source" : {
          "name_suggest" : {
            "input" : "John"
          }
        }
      }
    ]
  }
}

```

I use nginx as a reverse proxy, but there is no values from elasticsearch.  
I don't think nginx is the problem.

```
server {
    listen 80;
    server_name example.com;

    location / {
        proxy_pass http://172.31.18.8:8080;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }

    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/html;
    }
}
```

---

<div class="post-metadata">

**Author:** ![sumo7](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@sumo7](https://discuss.elastic.co/u/sumo7)\
**Post date:** [March 1, 2017, 6:10am UTC](https://discuss.elastic.co/t/cant-get-status-200/76727/26 "2017-03-01T06:10:58Z")

</div>

I hope you are still interested in this post because I have been struggling from this problem for more than 10 days.

---

<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 1, 2017, 7:25am UTC](https://discuss.elastic.co/t/cant-get-status-200/76727/27 "2017-03-01T07:25:30Z")

</div>

> [@sumo7](#):
>
> I hope you are still interested in this post because I have been struggling from this problem for more than 10 days.

Is it a way to put some pressure on my shoulders? If that was your intention, please read the last part of [About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) (Be patient section).

You just opened this one day ago and I think I already answered a lot but you wasted a lot of time by not giving the details I was asking for.

FWIW I wrote my last answer

> [@Can't get status 200](https://discuss.elastic.co/t/cant-get-status-200/76727/24):
>
> Can you run a simple curl command to run a \_search query for example? Did you say at some point that you have a nginx layer?

at 4:45 AM my timezone.

So please, be patient. If you need SLAs on your questions, I can connect you to our sales.

Thanks.

---

<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 1, 2017, 7:30am UTC](https://discuss.elastic.co/t/cant-get-status-200/76727/28 "2017-03-01T07:30:40Z")

</div>

Can you run:

```auto
curl -XPOST "http://172.31.18.8:9200/users/_suggest?pretty" -d '{
    "docsuggest": {
      "text": "l",
      "completion": {
        "field": "name_suggest",
        "fuzzy": true
      }
    }
  }'

```

BTW `_suggest` endpoint os deprecated. Can you use instead `_search` as described at [https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-suggesters.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-suggesters.html)

So run something like:

```auto
curl -XPOST 'http://172.31.18.8:9200/users/_search?pretty' -H 'Content-Type: application/json' -d'
{
  "suggest" : {
    "docsuggest" : {
      "text" : "l",
      "completion" : {
        "field" : "name_suggest",
        "fuzzy": true
      }
    }
  }
}'

```

---

<div class="post-metadata">

**Author:** ![sumo7](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@sumo7](https://discuss.elastic.co/u/sumo7)\
**Post date:** [March 1, 2017, 7:40am UTC](https://discuss.elastic.co/t/cant-get-status-200/76727/29 "2017-03-01T07:40:24Z")

</div>

If I sounded disrespectful to you, I'm sorry.  
Thank you for taking your time.

The below is the result for running that query.

```
curl -XPOST 'http://172.31.18.8:9200/users/_search?pretty' -H 'Content-Type: application/json' -d'
> {
> "suggest" : {
> "docsuggest" : {
> "text" : "l",
> "completion" : {
> "field" : "name_suggest",
> "fuzzy": true
> }
> }
> }
> }'
[2017-03-01T07:34:04,414][DEBUG][o.e.a.s.TransportSearchAction] [ip-172-31-18-8] [users][0], node[1thzIqqtR269aDnkaTas6w], [P], s[STARTED], a[id=TSHiN9cJThifHfabH3kReQ]: Failed to execute [SearchRequest{searchType=QUERY_AND_FETCH, indices=[users], indicesOptions=IndicesOptions[id=38, ignore_unavailable=false, allow_no_indices=true, expand_wildcards_open=true, expand_wildcards_closed=false, allow_alisases_to_multiple_indices=true, forbid_closed_indices=true], types=[], routing='null', preference='null', requestCache=false, scroll=null, source={
  "suggest" : {
    "docsuggest" : {
      "text" : "l",
      "completion" : {
        "field" : "name_suggest",
        "fuzzy" : {
          "fuzziness" : 1,
          "transpositions" : true,
          "min_length" : 3,
          "prefix_length" : 1,
          "unicode_aware" : false,
          "max_determinized_states" : 10000
        }
      }
    }
  }
}}]
org.elasticsearch.transport.RemoteTransportException: [ip-172-31-18-8][172.31.18.8:9300][indices:data/read/search[phase/query+fetch]]
Caused by: java.lang.IllegalArgumentException: no mapping found for field [name_suggest]
	at org.elasticsearch.search.suggest.SuggestionBuilder.populateCommonFields(SuggestionBuilder.java:313) ~[elasticsearch-5.2.2.jar:5.2.2]
	at org.elasticsearch.search.suggest.completion.CompletionSuggestionBuilder.build(CompletionSuggestionBuilder.java:361) ~[elasticsearch-5.2.2.jar:5.2.2]
	at org.elasticsearch.search.suggest.SuggestBuilder.build(SuggestBuilder.java:178) ~[elasticsearch-5.2.2.jar:5.2.2]
	at org.elasticsearch.search.SearchService.parseSource(SearchService.java:718) ~[elasticsearch-5.2.2.jar:5.2.2]
	at org.elasticsearch.search.SearchService.createContext(SearchService.java:540) ~[elasticsearch-5.2.2.jar:5.2.2]
	at org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:516) ~[elasticsearch-5.2.2.jar:5.2.2]
	at org.elasticsearch.search.SearchService.executeFetchPhase(SearchService.java:351) ~[elasticsearch-5.2.2.jar:5.2.2]
	at org.elasticsearch.action.search.SearchTransportService$9.messageReceived(SearchTransportService.java:322) ~[elasticsearch-5.2.2.jar:5.2.2]
	at org.elasticsearch.action.search.SearchTransportService$9.messageReceived(SearchTransportService.java:319) ~[elasticsearch-5.2.2.jar:5.2.2]
	at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:69) ~[elasticsearch-5.2.2.jar:5.2.2]
	at org.elasticsearch.transport.TransportService$7.doRun(TransportService.java:610) [elasticsearch-5.2.2.jar:5.2.2]
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:596) [elasticsearch-5.2.2.jar:5.2.2]
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-5.2.2.jar:5.2.2]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_121]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_121]
[2017-03-01T07:34:04,416][DEBUG][o.e.a.s.TransportSearchAction] [ip-172-31-18-8] All shards failed for phase: [query_fetch]
org.elasticsearch.transport.RemoteTransportException: [ip-172-31-18-8][172.31.18.8:9300][indices:data/read/search[phase/query+fetch]]
Caused by: java.lang.IllegalArgumentException: no mapping found for field [name_suggest]
	at org.elasticsearch.search.suggest.SuggestionBuilder.populateCommonFields(SuggestionBuilder.java:313) ~[elasticsearch-5.2.2.jar:5.2.2]
	at org.elasticsearch.search.suggest.completion.CompletionSuggestionBuilder.build(CompletionSuggestionBuilder.java:361) ~[elasticsearch-5.2.2.jar:5.2.2]
	at org.elasticsearch.search.suggest.SuggestBuilder.build(SuggestBuilder.java:178) ~[elasticsearch-5.2.2.jar:5.2.2]
	at org.elasticsearch.search.SearchService.parseSource(SearchService.java:718) ~[elasticsearch-5.2.2.jar:5.2.2]
	at org.elasticsearch.search.SearchService.createContext(SearchService.java:540) ~[elasticsearch-5.2.2.jar:5.2.2]
	at org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:516) ~[elasticsearch-5.2.2.jar:5.2.2]
	at org.elasticsearch.search.SearchService.executeFetchPhase(SearchService.java:351) ~[elasticsearch-5.2.2.jar:5.2.2]
	at org.elasticsearch.action.search.SearchTransportService$9.messageReceived(SearchTransportService.java:322) ~[elasticsearch-5.2.2.jar:5.2.2]
	at org.elasticsearch.action.search.SearchTransportService$9.messageReceived(SearchTransportService.java:319) ~[elasticsearch-5.2.2.jar:5.2.2]
	at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:69) ~[elasticsearch-5.2.2.jar:5.2.2]
	at org.elasticsearch.transport.TransportService$7.doRun(TransportService.java:610) [elasticsearch-5.2.2.jar:5.2.2]
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:596) [elasticsearch-5.2.2.jar:5.2.2]
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-5.2.2.jar:5.2.2]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_121]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_121]
{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "no mapping found for field [name_suggest]"
      }
    ],
    "type" : "search_phase_execution_exception",

    "reason" : "all shards failed",
    "phase" : "query_fetch",
    "grouped" : true,
    "failed_shards" : [
      {
        "shard" : 0,
        "index" : "users",
        "node" : "1thzIqqtR269aDnkaTas6w",
        "reason" : {
          "type" : "illegal_argument_exception",
          "reason" : "no mapping found for field [name_suggest]"
        }
      }
    ],
    "caused_by" : {
      "type" : "illegal_argument_exception",
      "reason" : "no mapping found for field [name_suggest]"
    }
  },
  "status" : 400
}
```

---

<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 1, 2017, 8:09am UTC](https://discuss.elastic.co/t/cant-get-status-200/76727/30 "2017-03-01T08:09:26Z")

</div>

So it tells you what is wrong here. `name_suggest` does not exist in your mapping apparently.

---

<div class="post-metadata">

**Author:** ![sumo7](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@sumo7](https://discuss.elastic.co/u/sumo7)\
**Post date:** [March 1, 2017, 8:13am UTC](https://discuss.elastic.co/t/cant-get-status-200/76727/31 "2017-03-01T08:13:19Z")

</div>

I will look into that but I also realized that when I use \_search instead of \_suggest, searching fails even in the development environment.

```
TRACE: 2017-03-01T08:11:50Z
  -> POST http://localhost:9200/users/_search
  {
    "docsuggest": {
      "text": "a",
      "completion": {
        "field": "name_suggest",
        "fuzzy": true
      }
    }
  }
  <- 400
  {
    "error": {
      "root_cause": [
        {
          "type": "parsing_exception",
          "reason": "Unknown key for a START_OBJECT in [docsuggest].",
          "line": 1,
          "col": 15
        }
      ],
      "type": "parsing_exception",
      "reason": "Unknown key for a START_OBJECT in [docsuggest].",
      "line": 1,
      "col": 15
    },
    "status": 400
  }
```

---

<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 1, 2017, 8:26am UTC](https://discuss.elastic.co/t/cant-get-status-200/76727/32 "2017-03-01T08:26:43Z")

</div>

> [@sumo7](#):
>
> when I use \_search instead of \_suggest, searching fails even in the development environment.

Incorrect syntax. read again my post

> [@Can't get status 200](https://discuss.elastic.co/t/cant-get-status-200/76727/28):
>
> Can you run: curl -XPOST "http://172.31.18.8:9200/users/\_suggest?pretty" -d '{ "docsuggest": { "text": "l", "completion": { "field": "name\_suggest", "fuzzy": true } } }' BTW \_suggest endpoint os deprecated. Can you use instead \_search as described at [https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-suggesters.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-suggesters.html) So run something like: curl -XPOST 'http://172.31.18.8:9200/users/\_search?pretty' -H 'Content-Type: application/json' …

---

<div class="post-metadata">

**Author:** ![sumo7](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@sumo7](https://discuss.elastic.co/u/sumo7)\
**Post date:** [March 1, 2017, 9:21am UTC](https://discuss.elastic.co/t/cant-get-status-200/76727/33 "2017-03-01T09:21:18Z")

</div>

You were right. I input `name_suggest` as `name_sugggest`, there was an extra `g`.  
I guess I did make this mistake while I was deleting and creating index to fix the problem.  
The mistake wasn't there when I created this post like you can see from my earlier post with `curl -XGET '172.31.18.8:9200/users?pretty'`

**The problem still exists.**  
It still returns status code 0.

But I was able to run the query successfully this time.

```
curl -XPOST 'http://172.31.18.8:9200/users/_search?pretty' -H 'Content-Type: application/json' -d'
> {
> "suggest" : {
> "docsuggest" : {
> "text" : "l",
> "completion" : {
> "field" : "name_suggest",
> "fuzzy": true
> }
> }
> }
> }'
{
  "took" : 21,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "failed" : 0
  },
  "hits" : {
    "total" : 0,
    "max_score" : 0.0,
    "hits" : []
  },
  "suggest" : {
    "docsuggest" : [
      {
        "text" : "l",
        "offset" : 0,
        "length" : 1,
        "options" : []
      }
    ]
  }
}
```

---

<div class="post-metadata">

**Author:** ![sumo7](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@sumo7](https://discuss.elastic.co/u/sumo7)\
**Post date:** [March 1, 2017, 9:36am UTC](https://discuss.elastic.co/t/cant-get-status-200/76727/34 "2017-03-01T09:36:47Z")

</div>

Is the syntax of \_search same as \_suggest?

I feel like I can fix the problem If I find a way to run \_search query successfully with my Javascript API in the development environment.

This syntax doesn't work:

```
 client.search({
   index: "users",
   body: {
     docsuggest: {
       text: search_query,
       completion: {
         field: "name_suggest",
         fuzzy: true
       }
     }
   }
 })

```

Error

```
TRACE: 2017-03-01T09:42:31Z
  -> POST http://localhost:9200/users/_search
  {
    "docsuggest": {
      "text": "a",
      "completion": {
        "field": "name_suggest",
        "fuzzy": true
      }
    }
  }
  <- 400
  {
    "error": {
      "root_cause": [
        {
          "type": "parsing_exception",
          "reason": "Unknown key for a START_OBJECT in [docsuggest].",
          "line": 1,
          "col": 15
        }
      ],
      "type": "parsing_exception",
      "reason": "Unknown key for a START_OBJECT in [docsuggest].",
      "line": 1,
      "col": 15
    },
    "status": 400
  }

```

This syntax works:

```
client.suggest({
  index: "users",
  body: {
    docsuggest: {
      text: search_query,
      completion: {
        field: "name_suggest",
        fuzzy: true
      }
    }
  }
})

```

Success

```
TRACE: 2017-03-01T09:46:10Z
  -> POST http://localhost:9200/users/_suggest
  {
    "docsuggest": {
      "text": "a",
      "completion": {
        "field": "name_suggest",
        "fuzzy": true
      }
    }
  }
  <- 200
  {
    "_shards": {
      "total": 5,
      "successful": 5,
      "failed": 0
    },
    "docsuggest": [
      {
        "text": "a",
        "offset": 0,
        "length": 1,
        "options": []
      }
    ]
  }
```

---

<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 1, 2017, 9:48am UTC](https://discuss.elastic.co/t/cant-get-status-200/76727/35 "2017-03-01T09:48:46Z")

</div>

> Is the syntax of \_search same as \_suggest?

No. Again read my post. [Can't get status 200 - #28 by dadoonet](https://discuss.elastic.co/t/cant-get-status-200/76727/28)

I wrote:

```auto
curl -XPOST 'http://172.31.18.8:9200/users/_search?pretty' -H 'Content-Type: application/json' -d'
{
  "suggest" : {
    "docsuggest" : {
      "text" : "l",
      "completion" : {
        "field" : "name_suggest",
        "fuzzy": true
      }
    }
  }
}'

```

---

<div class="post-metadata">

**Author:** ![sumo7](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@sumo7](https://discuss.elastic.co/u/sumo7)\
**Post date:** [March 1, 2017, 10:31am UTC](https://discuss.elastic.co/t/cant-get-status-200/76727/36 "2017-03-01T10:31:08Z")

</div>

I was able to make the `_search` query work in my development environment.  
It can retrieve the data stored and show it on the local site like before.

But the problem still exists in my production environment even after the usage of `_search`.  
It returns status code 0.

---

<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 1, 2017, 10:58am UTC](https://discuss.elastic.co/t/cant-get-status-200/76727/37 "2017-03-01T10:58:09Z")

</div>

Can you run again the curl command and paste the results here?

---

<div class="post-metadata">

**Author:** ![sumo7](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@sumo7](https://discuss.elastic.co/u/sumo7)\
**Post date:** [March 1, 2017, 11:00am UTC](https://discuss.elastic.co/t/cant-get-status-200/76727/38 "2017-03-01T11:00:33Z")

</div>

```
curl -XPOST 'http://172.31.18.8:9200/users/_search?pretty' -H 'Content-Type: application/json' -d'
> {
> "suggest" : {
> "docsuggest" : {
> "text" : "l",
> "completion" : {
> "field" : "name_suggest",
> "fuzzy": true
> }
> }
> }
> }'
{
  "took" : 2,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "failed" : 0
  },
  "hits" : {
    "total" : 0,
    "max_score" : 0.0,
    "hits" : []
  },
  "suggest" : {
    "docsuggest" : [
      {
        "text" : "l",
        "offset" : 0,
        "length" : 1,
        "options" : []
      }
    ]
  }
}
```

---

<div class="post-metadata">

**Author:** ![sumo7](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@sumo7](https://discuss.elastic.co/u/sumo7)\
**Post date:** [March 1, 2017, 11:07am UTC](https://discuss.elastic.co/t/cant-get-status-200/76727/39 "2017-03-01T11:07:51Z")

</div>

I can get results if I use `_search` query with `curl` like the following.

```
curl -XPOST 'http://172.31.18.8:9200/users/_search?pretty' -H 'Content-Type: application/json' -d'
{
  "suggest" : {
    "docsuggest" : {
      "text" : "j",
      "completion" : {
        "field" : "name_suggest",
        "fuzzy": true
      }
    }
  }
> }'
{
  "took" : 3,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "failed" : 0
  },
  "hits" : {
    "total" : 0,
    "max_score" : 0.0,
    "hits" : []
  },
  "suggest" : {
    "docsuggest" : [
      {
        "text" : "o",
        "offset" : 0,
        "length" : 1,
        "options" : [
          {
            "text" : "John",
            "_index" : "users",
            "_type" : "user",
            "_id" : "John",
            "_score" : 1.0,
            "_source" : {
              "name_suggest" : {
                "input" : "John"
              }
            }
          }
        ]
      }
    ]
  }
}

```

I just can't get results when I use `_search` query with Javascript API in the production environment.  
Strangely it works in the development environment.

---

<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 1, 2017, 11:16am UTC](https://discuss.elastic.co/t/cant-get-status-200/76727/40 "2017-03-01T11:16:09Z")

</div>

Here we are. This is now a different question IMO.

We prove that elasticsearch is working well.

What does your javascript code is looking like? That said I'm not the right person to comment JS code.

---

<div class="post-metadata">

**Author:** ![sumo7](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@sumo7](https://discuss.elastic.co/u/sumo7)\
**Post date:** [March 1, 2017, 11:17am UTC](https://discuss.elastic.co/t/cant-get-status-200/76727/41 "2017-03-01T11:17:08Z")

</div>

My Javascript code is 100% correct.  
Why?  
I use the same code as the development.

---

<div class="post-metadata">

**Author:** ![sumo7](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@sumo7](https://discuss.elastic.co/u/sumo7)\
**Post date:** [March 1, 2017, 11:38am UTC](https://discuss.elastic.co/t/cant-get-status-200/76727/42 "2017-03-01T11:38:33Z")

</div>

I guess we couldn't reach a solution.

But I learned a lot from you, so thank you so much for sticking with me.  
I will keep working to solve this issue.  
If I find a solution, I will post it here.  
So if you find anything, please post it here too.

Thanks again.

[Previous page](https://discuss.elastic.co/t/cant-get-status-200/76727.md?page=1)

[Next page](https://discuss.elastic.co/t/cant-get-status-200/76727.md?page=3)
