【发布时间】:2016-10-30 06:35:07
【问题描述】:
有一个 ElasticSearch 索引,其中潜在的命中是这样构建的:
id: number,
source: string,
type: string,
organization: {
main: [string],
support: [string]
},
title: {
main: [string],
sub: [string]
}
我的问题是我无法搜索 [] 中的元素。
这样做没问题:
var searchResults = client.Search<Document>(s => s
.Index(****)
.Type(****)
.MatchAll()
.Query(q =>
q.Term(p => p.source, "some source name")
))
但是这个不行:
var searchResults = client.Search<Document>(s => s
.Index(****)
.Type(****)
.MatchAll()
.Query(q =>
q.Term(p => p.organization.main[0], "some organization name")
))
这个版本我也试过了,还是不行:
var searchResults = client.Search<Document>(s => s
.Index(****)
.Type(****)
.MatchAll()
.Query(q =>
q.Term(p => p.organization.main, "some organization name")
))
谁能发现哪里出了问题?
【问题讨论】:
-
可以分享索引映射吗?
标签: c# elasticsearch nest