如果有人可以提供帮助? 1.全文搜索查询,其中标题和描述都是顶级字段
GET /docidx/Document/_search
{
"query": {
"query_string": {
"query": "title:computer AND description:electronics"
}
}
}
This works fine.
2. The full text search query where title is top level field but "abstract.content" i.e content is a nested field under abstract - does not return results.
GET /docidx/Document/_search
{
"query": {
"query_string": {
"query": "title:computer AND abstract.content:memory"
}
}
}
Does Elastic Search has support for full text search for nested fields?
答案 0 :(得分:0)
使用must
和nested Query
的组合:
GET /docidx/Document/_search
{
"query": {
"bool": {
"must": [
{
"query_string": {
"default_field": "title",
"query": "computer"
}
},
{
"nested": {
"path": "abstract",
"query": {
"query_string": {
"default_field": "abstract.content",
"query": "memory"
}
}
}
}
]
}
}
}