我有两个疑问。
{'bool':
{'must':
{ 'terms': 'metadata.loc':['ten','twenty']}
{ 'terms': 'metadata.doc':['prince','queen']}
}
{'should':
{ 'match': 'text':'kingdom of dreams'}
}
},
{'highlight':
{'text':
{'type':fvh,
'matched_fields':['metadata.doc','text']
}
}
}
有两个问题?
为什么带有 should 查询匹配的文档被突出显示,而只有 must 术语匹配的文档没有被突出显示。
有什么方法可以提及特定于上述术语查询的突出显示条件吗?
这意味着突出显示条件{ 'terms': 'metadata.loc':['ten','twenty']}
和一个单独的高亮条件{ 'terms': 'metadata.doc':['prince','queen']}