关于elasticsearch的高亮显示

有没有人了解 elasticsearch 在长文本的搜索时 结果高亮字段 如何替换掉原字段
比如你的文章大概700字 而你内容的高亮结果集每个只有100个字符 如何替换到原文中 尤其是在ik分词器后

可设置number_of_fragment的值为0,这样会在返回原文的情况下对相同的片段高亮显示。
number_of_fragments
The maximum number of fragments to return. If the number of fragments is set to 0, no fragments are returned. Instead, the entire field contents are highlighted and returned. This can be handy when you need to highlight short texts such as a title or address, but fragmentation is not required. If number_of_fragments is 0, fragment_size is ignored. Defaults to 5.
参阅https://www.elastic.co/guide/en/elasticsearch/reference/7.0/search-request-highlighting.html