我正在尝试通过术语在数组中搜索特定元素,但是在查询时却什么也没有 ps:我使用的是Elasticsearch 7.x。
我创建了以下查询:
POST spring/_search
{
"query": {
"nested": {
"path": "paragrafos",
"score_mode": "avg",
"query": {
"bool": {
"must": {
"match": {
"paragrafos.conteudo": """4 | Chapter 1: Terms\r?\n"""
}
}
}
}
}
}
}
我的映射是:
PUT spring/
{
"mappings": {
"properties": {
"downloadUrl": {
"type": "text",
"fielddata": true,
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"nome": {
"type": "text",
"fielddata": true,
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"paginas": {
"type": "nested",
"properties": {
"numeroPagina": {
"type": "long"
},
"paragrafos": {
"type": "long"
}
}
},
"paragrafos": {
"type": "nested",
"properties": {
"conteudo": {
"type": "text",
"fielddata": true,
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"paginaNumero": {
"type": "long"
}
}
}
}
}
}
我的数据是:
"id" : null,
"nome" : "BigData",
"downloadUrl" : "https://jdjscm.s3-us-west-2.amazonaws.com/teste/LEITE%2C+Carlos+Henrique+Bezerra.+Curso+de+Direito+Processual+do+Trabalho+(2015).pdf",
"paginas": [],
"paragrafos": [{"conteudo":"data", "paginaNumero": 5}, {"conteudo":"test", "paginaNumero": 6}, {"conteudo":"view", "paginaNumero": 7}
但是搜索时,我什么也没得到
{
"took" : 0,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 0,
"relation" : "eq"
},
"max_score" : null,
"hits" : [ ]
}
}
我的查询中有错误吗?
我的查询中有错误吗?
我已经对filter和filter进行了测试,但是返回了所有未过滤的对象;