我的问题是,是否可以编写弹性查询,以便可以针对所编写的特定过滤器实现突出显示?例如,假设我对查询应用了以下布尔过滤器:
{
"query_string": {
"query": "Harry Potter",
"fields": [
"document.metadata.title^1.0",
],
...
},
},
{
"query_string": {
"query": "Rowling",
"fields": [
"document.metadata.author^1.0",
],
...
},
},
]
...
"highlight" {
"fields": {
"report.metadata.title":{
"fragment_size": 100
},
"report.metadata.author":{
"fragment_size": 100
}
}
}
在这种情况下,我希望报告以下重点:
1. Title contains "Harry Potter" - Highlighting = TRUE
2. Author contains "Harry Potter" - Highlighting = FALSE
3. Title contains "Rowling" - Highlighting = FALSE
4. Author contains "Rowling" - Highlighting = TRUE
这可能吗?提前非常感谢