lucene中的突出显示 [英] hit highlighting in lucene

查看:89
本文介绍了lucene中的突出显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在搜索以lucene索引的字符串作为文档.现在我给它一个长字符串来匹配.

i am searching for strings indexed in lucene as documents. now i give it a long string to match.

示例:

"iamrohitbanga是一个stackoverflow用户"搜索字符串

"iamrohitbanga is a stackoverflow user" search string

文档:

文档1:字段值:rohit

document 1: field value: rohit

文档2:字段值:banga

document 2: field value: banga

现在我使用模糊匹配在文档中查找搜索字符串.

now i use fuzzy matching to find the search strings in the documents.

2个文档匹配.我想检索字符串rohit在搜索字符串中出现的位置.如何使用Lucene Java API做到这一点. 还应注意,模糊匹配也会导致不精确的匹配.但是我对搜索到的字符串中的位置词感兴趣.

the 2 documents match. i want to retrieve the position at which the string rohit occurs in the search string. how to do it using lucene java api. also note that the fuzzy matching would lead to inexact matches also. but i am interested in the position word in the searched string.

答案 从Lucene查找搜索结果的位置

是指要求我们从 http://www.iq-computing.de下载某些文件的网站. ,并且此页面无法加载.

refers to a website which requires us to download some files from http://www.iq-computing.de and this page does not load.

那么您能提供一个解决方案吗?

so could you provide a solution?

推荐答案

这可能会有所帮助: http://lucene.apache.org/java/2_9_1/api/contrib-highlighter/index.html

Probably this should help: http://lucene.apache.org/java/2_9_1/api/contrib-highlighter/index.html

这篇关于lucene中的突出显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆