【发布时间】:2015-11-12 03:20:17
【问题描述】:
这辈子都无法突出这一点。似乎弹性搜索在突出显示过滤子句中提到的字段方面被破坏了。下面的查询只是没有突出显示。这是 Elastic 的问题吗?我可以做些什么来完成这项工作?
{
"query": {
"filtered": {
"query": {
"bool": {
"must": [
{
"term": {
"language": "Austrian"
}
}
]
}
},
"filter": {
"and": [
{
"query": {
"query_string": {
"fields": [
"standard_analyzed_name",
"standard_analyzed_message"
],
"query": "Arnold AND Schwarz"
}
}
}
]
}
}
},
"size": 20,
"sort": [
{
"total_interactions": {
"order": "desc"
}
}
],
"highlight": {
"fields": {
"standard_analyzed_name": {
"pre_tags": [
"<strong>"
],
"post_tags": [
"</strong>"
],
"fragment_size": 500,
"number_of_fragments": 1
},
"standard_analyzed_message": {
"pre_tags": [
"<strong>"
],
"post_tags": [
"</strong>"
],
"fragment_size": 500,
"number_of_fragments": 1
}
}
}
}
更新
上述查询确实在弹性搜索 2.0.0 中突出显示 - Yayyy
【问题讨论】:
-
你能分享你的地图和一些可能有助于重现你的案例的文件吗?
-
谢谢,你的映射呢?
curl -XGET localhost:9200/facebook_posts/_mapping/document
标签: elasticsearch elasticsearch-plugin