elasticsearch 弹性搜索不会返回索引字段的查询结果
我正在使用弹性搜索按字段进行非常基本的搜索: 我的索引映射类似于:elasticsearch 弹性搜索不会返回索引字段的查询结果,elasticsearch,lucene,elasticsearch,Lucene,我正在使用弹性搜索按字段进行非常基本的搜索: 我的索引映射类似于: { "channels": { "mappings": { "channel": { "properties": { "channel": { "properties": { "description": { "type": "string" },
{
"channels": {
"mappings": {
"channel": {
"properties": {
"channel": {
"properties": {
"description": {
"type": "string"
},
"id": {
"type": "long"
},
"name": {
"type": "string"
},
.................
....................
我的问题是:
{
"query":
{
"match":
{
"description": "hubble"
}
}
}
现在,即使文档的“描述”字段中存在“哈勃”,该搜索结果也会命中0
但是,当我在_all字段上运行此查询时,它会按预期返回文档
如映射中所示,描述字段将作为全文进行分析(这是默认选项)。因此,当仅指定此字段时,搜索应返回命中
我遗漏了什么?使用“channel.description”会有所帮助。应该想到这一点
谢谢Val.请尝试使用
channel.description
,因为根据您的映射,似乎description
是channel
对象的内部字段;-)