Home
Sign Up
Sign In
V2EX
›
问与答
Elasticsearch 从正文中抽取匹配的那句话如何实现
AoaoAlex
·
Jan 9, 2019
· 2282 views
This topic created in 2860 days ago, the information mentioned may be changed or developed.
请问 Elasticsearch 从正文中抽取匹配的那句话如何实现,效果如下图
正文
抽取
img
匹配
7 replies
•
2019-01-09 11:58:32 +08:00
SoulSleep
Jan 9, 2019
1
高亮啊.....
我记得返回结果里直接把关键字给高亮的,甚至可以在 html 里使用
AoaoAlex
OP
Jan 9, 2019
2
@
SoulSleep
有一种情况是正文很长,匹配的关键词在正文的尾部。但是搜索列表中显示的空间有限,只能最多显示两行文字,此时会产生搜索的结果不是匹配内容的假象。
AoaoAlex
OP
Jan 9, 2019
3
@
SoulSleep
所以想要抽取长篇正文中匹配关键词的那一句话,想咨询是否有简单高效成熟的方案
amoia50
Jan 9, 2019
4
@
AoaoAlex
这个不是应该是前端的活吗,你只负责将符合搜索的全文找到,显示让前端来啊
oaix
Jan 9, 2019
5
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-highlighting.html
AoaoAlex
OP
Jan 9, 2019
6
@
oaix
👍
oaix
Jan 9, 2019
7
@
AoaoAlex
#6 其实 1 楼已经提到了,你误解了他的话。
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Privacy
·
Solana
·
558 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 26ms ·
UTC 19:21
·
PVG 03:21
·
LAX 11:21
·
JFK 14:21
♥ Do have faith in what you're doing.
❯