Elasticsearch поиск свойству не равно null
Elasticsearch поиск по свойству, то что оно не равно null. Делаю так .Query(s => s.Bool(b => b.Must(m => m.Exists(e => e.Field(f => f.fields.EventId.Id)))))
но в ответе нет документов.
Такие документы в самом elastic есть:"fields": { "address": "https://0.0.0.0:81", "EventId": { "Id": 14,"Name": "ListeningOnAddress"},
.
Это лог Logger из приложения.
Сами классы для мапинга,cоздал через специальную вставку у Visual Studio
2022.
public class _Source
{
[Date(Format = DateFormat.strict_date_hour_minute_second, Name = "@timestamp")]
public DateTime Timestamp { get; set; }
public string level { get; set; }
public string messageTemplate { get; set; }
public string message { get; set; }
public Fields fields { get; set; }
}
public class Fields
{
public string status { get; set; }
public string chargePoint { get; set; }
public Eventid EventId { get; set; }
public string SourceContext { get; set; }
public string ActionId { get; set; }
public string ActionName { get; set; }
public string RequestId { get; set; }
public string RequestPath { get; set; }
public string ConnectionId { get; set; }
public string MachineName { get; set; }
public object UserId { get; set; }
public string RemoteIpAddress { get; set; }
public string Environment { get; set; }
}
public class Eventid
{
public int Id { get; set; }
}
Источник: Stack Overflow на русском