Hi!
I need help with below query. I´m using .NET Nest library, and I need to convert it to Fluent DSL:
GET md-tpmiddle-f5-*/_count
{
"query": {
"bool": {
"filter": [
{
"bool": {
"filter": [
{
"bool": {
"should": [
{
"match": {
"virtual_ip": "15.2.5.54"
}
}
],
"minimum_should_match": 1
}
},
{
"bool": {
"should": [
{
"query_string": {
"query": "http_path like \\/WebTerminalCore*"
}
},
{
"bool": {
"should": [
{
"match": {
"http_path": "/wtrest"
}
}
],
"minimum_should_match": 1
}
}
],
"minimum_should_match": 1
}
}
]
}
},
{
"range": {
"@timestamp": {
"format": "strict_date_optional_time",
"gte": "2023-04-09T22:00:00.000Z",
"lte": "2023-04-09T22:15:00.000Z"
}
}
}
]
}
}
}
I have below code but it returns 0 hits:
searchResponse = clienteElastic.Search<DocumentElastic>(s =>
s.Query(q =>
q.Bool(b =>
b.Filter(f =>
f.Bool(bb =>
bb.Filter(ff =>
ff.Bool(bb => bb.Should(mu => mu.Match(m => m.Field("virtual_ip").Query(ipVirtualServer))).MinimumShouldMatch(1)) &&
ff.Bool(bb => bb.Should(q.QueryString(c => c.Query("http_path like \\/WebTerminalCore*")) && ff.Bool(bb => bb.Should(mu => mu.Match(m => m.Field("http_path").Query("/wtrest"))))))
)),
q => q.DateRange(m => m.Field("@timestamp").GreaterThanOrEquals(fechaInicio.AddMinutes(-intervaloMinutos)).LessThanOrEquals(fechaInicio))))));
What I'm doing wrong?
Thanks in advance.
Víctor