Lucene 快速矢量荧光笔片段
我是 Lucene 的新手。有没有办法让 Lucene FVH 返回以搜索查询为中心的片段/片段,而不是大约从搜索查询开始?另外,有没有办法告诉 FVH 分段器仅在换行符处分段? 谢谢!
Im new to Lucene. Is there a way to get the Lucene FVH to return fragments/snippets centered around the search query instead of approximately starting with the search query? Also, Is there a way to tell the FVH fragmenter to fragment only at the newline char?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Sujit Pal 在他的 Salmon Run 博客上描述了如何创建自己的片段构建器:http://sujitpal.blogspot.com/2011/05/customizing-lucenes-fast-vector.html
此外,Grant Ingersoll 在 Lucid 博客上发表了一篇关于使用 TermVectorMapper 构建窗口的帖子围绕术语,以便您可以提取 N 个前后术语: http://www.lucidimagination.com/blog/2009/05/26/accessing-words-around-a-positional-match-in-lucene/
Sujit Pal has a description of how to create your own fragments builder on his Salmon Run blog: http://sujitpal.blogspot.com/2011/05/customizing-lucenes-fast-vector.html
Also, Grant Ingersoll has a post at the Lucid blog about using a TermVectorMapper to construct a window around the terms so that you can pull N preceding and subsequent terms: http://www.lucidimagination.com/blog/2009/05/26/accessing-words-around-a-positional-match-in-lucene/
除了制作自己的碎片构建器之外,没有一种纯粹的 lucene 方法可以做到这一点。但是,您可以为 Solr 提供一个正则表达式,指示您希望片段的外观。请参阅文档。
There isn't a pure lucene way to do this, apart from making your own frag builder AFAIK. However, you can provide Solr with a regex indicating how you want fragments to look. See the docs.