riak 搜索结果摘录
有人知道 riaksearch 是否能够像 lucene 那样生成带有亮点的摘录吗?
Doeas anybody know if riaksearch has the ability to generate excerpt with highlight points in it similar to lucene does?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Riak Search 并未公开此功能,但只需做一些工作,您就可以创建一个粗略的近似值。
Riak Search 允许您将搜索结果输入到 MapReduce 作业中。如果这样做,那么您的 Map 或 Reduce 函数还将获取文档中与查询匹配的标记位置列表(这作为密钥数据公开,http://www.basho.com/search.php?q=keydata)。使用这些位置,您可以编写代码来标记文档或文本的摘录部分。
Riak Search doesn't expose this functionality out of the box, but with a little work you can create a rough approximation.
Riak Search allows you to feed search results into a MapReduce job. If you do this, then your Map or Reduce function will also get a list of token positions in the document that matched the query (this is exposed as keydata, http://www.basho.com/search.php?q=keydata). Using these positions, you can write code to mark up the document or excerpt portions of text.
我认为这个功能几乎不会在 Riak 中实现,因为它的哲学意味着它不关心值中到底存储了什么,因此除了提供一些元数据(如索引)之外,不会以任何有意义的方式处理它们。
I think this functionality will hardly ever be implemented in Riak since it's philisophy implies that it doesn't care about what exactly is stored in the values and therefore does not process them in any meaningful way except providing some metadata like indices.