elasticsearch Elasticsearch-术语为空?
我在匹配NEST中的空项时遇到问题。 我想通过查询得到一些细节。 它工作正常,但有一件事我不明白- 由于某种原因,我不能做一个等于空值的项。 我做错了什么 我的代码:
elasticsearch Elasticsearch-术语为空?,
elasticsearch,nest,
elasticsearch,Nest,我在匹配NEST中的空项时遇到问题。 我想通过查询得到一些细节。 它工作正常,但有一件事我不明白- 由于某种原因,我不能做一个等于空值的项。 我做错了什么 我的代码: result = _mainManager.Client.Search<object> (q => q .Type("Mail") .Query(c =>
result = _mainManager.Client.Search<object>
(q => q
.Type("Mail")
.Query(c =>
c.Term("SentMail_Sender_Id", userId) &&
c.Term("SentMail_EmbedAccountId", null) &&
!c.Term("SentMail_Status", Status.REMOVED.ToString().ToLower()) &&
c.Range(v => v.OnField("SentMail_Upload_Files_Count").Greater(0)))
.Size(int.MaxValue)
.Sort(s => s.OnField("SentMail_Creation_Date").Descending()));
找到了
result = _mainManager.Client.Search<object>
(q => q
.Type("Mail")
.Query(c =>
c.Term("SentMail_Sender_Id", userId) &&
!c.Term("SentMail_Status", Status.REMOVED.ToString().ToLower()) &&
c.Range(v => v.OnField("SentMail_Upload_Files_Count").Greater(0)))
.Filter(f => f.Missing("SentMail_EmbedAccountId"))
.Size(int.MaxValue)
.Sort(s => s.OnField("SentMail_Creation_Date").Descending()));
result=\u mainManager.Client.Search
(q=>q
.键入(“邮件”)
.Query(c=>
c、 术语(“SentMail\u Sender\u Id”,用户Id)&&
!c.Term(“SentMail_Status”,Status.REMOVED.ToString().ToLower())&&
c、 范围(v=>v.OnField(“SentMail\u Upload\u Files\u Count”)。更大(0)
.Filter(f=>f.Missing(“SentMail\u EmbedAccountId”))
.Size(int.MaxValue)
.Sort(s=>s.OnField(“SentMail\u Creation\u Date”).Descending());
result = _mainManager.Client.Search<object>
(q => q
.Type("Mail")
.Query(c =>
c.Term("SentMail_Sender_Id", userId) &&
!c.Term("SentMail_Status", Status.REMOVED.ToString().ToLower()) &&
c.Range(v => v.OnField("SentMail_Upload_Files_Count").Greater(0)))
.Filter(f => f.Missing("SentMail_EmbedAccountId"))
.Size(int.MaxValue)
.Sort(s => s.OnField("SentMail_Creation_Date").Descending()));