# Getting a Parse Failure when trying to query

**URL:** <https://discuss.elastic.co/t/getting-a-parse-failure-when-trying-to-query/37353>\
**Category:** Elasticsearch\
**Created:** [December 16, 2015, 12:50pm UTC](https://discuss.elastic.co/t/getting-a-parse-failure-when-trying-to-query/37353 "2015-12-16T12:50:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![emran](https://avatars.discourse-cdn.com/v4/letter/e/b9bd4f/32.png) [@emran](https://discuss.elastic.co/u/emran)\
**Post date:** [December 16, 2015, 12:50pm UTC](https://discuss.elastic.co/t/getting-a-parse-failure-when-trying-to-query/37353/1 "2015-12-16T12:50:39Z")

</div>

I have a form which provides suggestion drop down.  
The form has stopped showing suggestions and when I checked log the error below is logged whenever the form is used.

Can you please tell me what is this error stating and how can I fix this?

Elasticsearch.Net.ElasticsearchServerException:

Failed to execute phase [query\_fetch],  
all shards failed; shardFailures {  
[vRSnhOHmTMaweJtIH-jEzQ][gts][0]: SearchParseException[[gts][0]: from[0],  
size[20]:  
Parse Failure [Failed to parse source [{  
"from": 0,  
"size": 20,  
"suggest": {  
"SuggestLocation": {  
"text": "Scotla",  
"completion": {  
"field": "locationSuggest"  
}  
}  
}  
}]]]; nested: ClassCastException; }

---

<div class="post-metadata">

**Author:** ![emran](https://avatars.discourse-cdn.com/v4/letter/e/b9bd4f/32.png) [@emran](https://discuss.elastic.co/u/emran)\
**Post date:** [December 16, 2015, 2:06pm UTC](https://discuss.elastic.co/t/getting-a-parse-failure-when-trying-to-query/37353/2 "2015-12-16T14:06:01Z")

</div>

When I try to debug this in Visual Studio, I receive this error:

**The remote server returned an error: (400) Bad Request.**

Note that this is an Ajax request on keyup event.

anyone ?

---

<div class="post-metadata">

**Author:** ![shaunak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaunak/32/6643_2.png) [@shaunak](https://discuss.elastic.co/u/shaunak)\
**Post date:** [December 16, 2015, 2:08pm UTC](https://discuss.elastic.co/t/getting-a-parse-failure-when-trying-to-query/37353/3 "2015-12-16T14:08:09Z")

</div>

Using the Visual Studio debugger, would it be possible for you to capture the complete request body being sent to Elasticsearch and paste it here?

---

<div class="post-metadata">

**Author:** ![emran](https://avatars.discourse-cdn.com/v4/letter/e/b9bd4f/32.png) [@emran](https://discuss.elastic.co/u/emran)\
**Post date:** [December 16, 2015, 2:29pm UTC](https://discuss.elastic.co/t/getting-a-parse-failure-when-trying-to-query/37353/4 "2015-12-16T14:29:31Z")

</div>

I couldn't find the request body in VS Debug, so I got it using Fiddler

POST /gs/usermodel/\_search HTTP/1.1  
Accept: application/json  
Content-Type: application/json  
Host: [sv1.xxx.org:9200](http://sv1.xxx.org:9200)  
Content-Length: 187

---

<div class="post-metadata">

**Author:** ![emran](https://avatars.discourse-cdn.com/v4/letter/e/b9bd4f/32.png) [@emran](https://discuss.elastic.co/u/emran)\
**Post date:** [December 16, 2015, 2:31pm UTC](https://discuss.elastic.co/t/getting-a-parse-failure-when-trying-to-query/37353/5 "2015-12-16T14:31:47Z")

</div>

POST [http://sv1.xxx.org:9200/gs/usermodel/\_search](http://sv1.xxx.org:9200/gs/usermodel/_search) HTTP/1.1  
Accept: application/json  
Content-Type: application/json  
Host: [sv1.xxx.org:9200](http://sv1.xxx.org:9200)  
Content-Length: 187

```
{
  "from": 0,
  "size": 20,
  "suggest": {
    "SuggestLocation": {
      "text": "leeds",
      "completion": {
        "field": "locationSuggest"
      }
    }
  }
}
```

---

<div class="post-metadata">

**Author:** ![emran](https://avatars.discourse-cdn.com/v4/letter/e/b9bd4f/32.png) [@emran](https://discuss.elastic.co/u/emran)\
**Post date:** [December 16, 2015, 3:14pm UTC](https://discuss.elastic.co/t/getting-a-parse-failure-when-trying-to-query/37353/6 "2015-12-16T15:14:03Z")

</div>

System.Net.WebException occured

**HResult=** -2146233079  
**Message=** The remote server returned an error: (400) Bad Request.

anyone?

---

<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, 11:30pm UTC](https://discuss.elastic.co/t/getting-a-parse-failure-when-trying-to-query/37353/7 "2017-07-05T23:30:33Z")

</div>


