I am trying to convert the below elastic search DSL to a NEST query, I am using version 5.2 of elasticsearch
GET articles/_search
{
"query": {
"bool": {
"must": [
{
"multi_match": {
"query": "FIY",
"fields": [
"title"
]
}
},
{
"nested": {
"path": "tags",
"query": {
"terms": {
"tags.tagName": [
"competition"
]
}
}
}
}
]
}
}
}
So far I have got the below, I know that the filter part shouldn't be in there, but I cant seem to add the Nested part without it
var result = client.Search<Article>(x => x
.Query(q => q
.Bool(b => b
.Must(m => m
.MultiMatch(mp => mp
.Query(query)
.Fields(f => f
.Fields(f1 => f1.Title, f2 => f2.Content, f3 => f3.Tags))))
.Filter(f => f
.Nested(n => n
.Path("tags")
.Query(q1 => q1
.Terms(t1 => t1.Field(f2 => f2.Tags).Terms(tags))
))))));