I have a search that is giving the correct results and trying to get it to work in .NET Nest but I can't seem to get the correct syntax. Here is the elastricsearch query that I have:
{
"query": {
"filtered": {
"query": {
"match": { "formattedName": "Michael" }
},
"filter": {
"bool": {
"must": [
{ "term": { "projectId": "5022" } },
{ "term": { "isInvalid": "false" } }
]
}
}
}
}
}
In my solution I have the following:
var lst = client.Search<EntitySearchItem>(s => s
.Size(recordCount)
.Index("entitysearch")
.Filter(f => f
.Bool(b => b
.Must(m => m.Term("projectId", projectId),
m => m.Term("isInvalid", "false"))))
.Query(q => q
.Match(p => p.OnField(f => f.FormattedName).Query(name))));
Does anyone familiar with Nest know how I can get the same results? Thanks!