Getting a Parse Failure when trying to query


#1

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; }


#2

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 ?


(Shaunak Kashyap) #3

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?


#4

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
Content-Length: 187


#5

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

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

#6

System.Net.WebException occured

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

anyone?


(system) #7