# How to pass raw query?

**URL:** <https://discuss.elastic.co/t/how-to-pass-raw-query/31632>\
**Category:** Elasticsearch\
**Created:** [October 5, 2015, 12:55pm UTC](https://discuss.elastic.co/t/how-to-pass-raw-query/31632 "2015-10-05T12:55:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shekhar\_chauhan](https://avatars.discourse-cdn.com/v4/letter/s/46a35a/32.png) [@shekhar\_chauhan](https://discuss.elastic.co/u/shekhar_chauhan)\
**Post date:** [October 5, 2015, 12:55pm UTC](https://discuss.elastic.co/t/how-to-pass-raw-query/31632/1 "2015-10-05T12:55:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 6, 2015, 3:40am UTC](https://discuss.elastic.co/t/how-to-pass-raw-query/31632/2 "2015-10-06T03:40:01Z")

</div>

What's the error you are getting?

---

<div class="post-metadata">

**Author:** ![shekhar\_chauhan](https://avatars.discourse-cdn.com/v4/letter/s/46a35a/32.png) [@shekhar\_chauhan](https://discuss.elastic.co/u/shekhar_chauhan)\
**Post date:** [October 6, 2015, 6:51am UTC](https://discuss.elastic.co/t/how-to-pass-raw-query/31632/3 "2015-10-06T06:51:43Z")

</div>

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.

---

<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:46pm UTC](https://discuss.elastic.co/t/how-to-pass-raw-query/31632/4 "2017-07-05T23:46:36Z")

</div>


