【发布时间】:2018-07-08 05:38:30
【问题描述】:
美好的一天:
我正在使用 ElasticSearch/NEST 来查询嵌套对象。我意识到我的嵌套对象是空的,但是尽管现在有匹配项,但仍返回了父对象。
ISearchResponse<Facility> responses = await this._elasticClient.SearchAsync<Facility>(a => a.Query(q =>
q.Bool(b =>
b.Must(m =>
m.Nested(n =>
n.Query(nq =>
nq.Term(t =>t.Field(f => f.Reviews.First().UserId).Value(user.Id))
).InnerHits(ih => ih.From(0).Size(1).Name("UserWithReview"))
)
)
)
));
当我查看生成的查询时,我更加困惑发生了什么:
Successful low level call on POST: /dev/doc/_search?typed_keys=true
# Audit trail of this API call:
- [1] HealthyResponse: Node: http://localhost:9200/ Took: 00:00:00.9806442
# Request:
{}
如您所见,请求为空。
【问题讨论】:
标签: elasticsearch nest