# Convert simple JSON Query to Nest C#

**URL:** <https://discuss.elastic.co/t/convert-simple-json-query-to-nest-c/42650>\
**Category:** Elasticsearch\
**Created:** [February 24, 2016, 10:56pm UTC](https://discuss.elastic.co/t/convert-simple-json-query-to-nest-c/42650 "2016-02-24T22:56:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![devhero](https://avatars.discourse-cdn.com/v4/letter/d/5fc32e/32.png) [@devhero](https://discuss.elastic.co/u/devhero)\
**Post date:** [February 24, 2016, 10:56pm UTC](https://discuss.elastic.co/t/convert-simple-json-query-to-nest-c/42650/1 "2016-02-24T22:56:16Z")

</div>

Hello Everyone,

Can someone please help me here.  
I spent many hours trying to convert this simple JSON query to C# NEST (v2.0.2) syntax with no luck .

{  
"fields": [],  
"query": {  
"match": {  
"file.content": "mySearch"  
}  
},  
"highlight": {  
"fields": {  
"file.content": {  
"number\_of\_fragments": 0  
}  
}  
}  
}

this is what I tried :  
var searchResults = client.Search (body =\>  
body.Query (query =\> query  
.QueryString (qs =\> qs  
.Query (mySearch)))  
.Highlight (h =\> h  
.Fields (fs =\> fs  
.Field (p =\> p.File.Content).Type (HighlighterType.Fvh)  
.NumberOfFragments (0)  
)  
)  
);

changing or removing the highlighter type didn't help.

searchResults.Highlights.Count is 0  
but searchResults.Documents has the right number of documents.

Thanks.

---

<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:13pm UTC](https://discuss.elastic.co/t/convert-simple-json-query-to-nest-c/42650/2 "2017-07-05T23:13:50Z")

</div>


