How to pass raw query?


(shekhar chauhan) #1

I was using nest dll of version 0.11.4.0. But I updated it with version of 1.7.1. Problem statement is - I am sending raw query string with code given below -
var connectionstatus = elasticClient.Raw.SearchPost(index, index, rawquery);
IQueryResponse response= elasticClient.ToParsedResponse<QueryResponse>(connectionstatus);

But after updation of nest dll ,this code is giving error.

raw query is -
string rawquery = @" {
""size"": 999,
""query"": {
""filtered"": {
""query"": {
""query_string"": {
""fields"": [
""SearchTags""
,""checklistId""],"
+ chkId +
","default_operator":" + ""AND"" +
"}}" +
","filter":" + "{" +
""geo_distance":" + "{"
+ distance +
"," +
""geolocation"" + ": {" +
latitude + "," +
longitude +
"}" +
"}" +
"}" +
"}" +
"}" +
"}";


(Mark Walkom) #2

What's the error you are getting?


(shekhar chauhan) #3

Error is -
Elasticsearch does not contain definition for searchpost() and ToParsedResponse<QueryResponse>(ConnectionStatus status).
Now i am trying elasticclient.raw.search() instead of elasticclient.raw.searchpost() . it gives status code 200 looks like query giving response correctly but i am not able to parse it in my object.


(system) #4