看,灰机...

elasticsearch高亮检索

Elasticsearch | 作者 zhangyuitgit | 发布于2018年03月16日 | 阅读数:2006

es高亮检索field数据不完整是怎么回事呢
已邀请:

laoyang360 - 《一本书讲透Elasticsearch》作者,Elastic认证工程师 [死磕Elasitcsearch]知识星球地址:http://t.cn/RmwM3N9;微信公众号:铭毅天下; 博客:https://elastic.blog.csdn.net

赞同来自:

分词原因,一般是。确认下用的什么分词,单独分词试试

zhangyuitgit - 帝都的一枚屌丝

赞同来自:

我用的默认的分词器,有个字段是存储文章的,但是做高亮检索的话,如果按照id去获取的话,那没问题,如果按照文章字段去做高亮检索的话,有些文章检索出来的不全。之前一个document的文章可能是1000个字,但是现在只有300个字

laoyang360 - 《一本书讲透Elasticsearch》作者,Elastic认证工程师 [死磕Elasitcsearch]知识星球地址:http://t.cn/RmwM3N9;微信公众号:铭毅天下; 博客:https://elastic.blog.csdn.net

赞同来自:

官网:Highlighted Fragmentsedit
Each field highlighted can control the size of the highlighted fragment in characters (defaults to 100), and the maximum number of fragments to return (defaults to 5). For example:

GET /_search
{
"query" : {
"match": { "user": "kimchy" }
},
"highlight" : {
"fields" : {
"content" : {"fragment_size" : 150, "number_of_fragments" : 3}
}
}
}

https://www.elastic.co/guide/e ... .html

有大小可以控制的

要回复问题请先登录注册