hit highlighting in lucene

早过忘川 提交于 2020-01-17 01:11:36

问题


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

example:

"iamrohitbanga is a stackoverflow user" search string

documents:

document 1: field value: rohit

document 2: field value: banga

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

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.

the answer to Finding the position of search hits from Lucene

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?


回答1:


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



来源:https://stackoverflow.com/questions/2208839/hit-highlighting-in-lucene

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!