lucene.net get starting and end index of a highlighted fragment in a searched field
Posted
by user339995
on Stack Overflow
See other posts from Stack Overflow
or by user339995
Published on 2010-05-13T06:29:40Z
Indexed on
2010/05/13
6:34 UTC
Read the original article
Hit count: 488
lucene.net
|fragment
"My search returns a highlighted fragment from a field. I want to know that in that field of particular searched document, where does that fragment starts and ends ?"
for instance.
consider i am searching "highlighted fragment" in above lines (consider the above para as single document).
I am setting my fragmenter as :
SimpleFragmenter fragmenter =
new SimpleFragmenter(30);
now the output of GetBestFragment is somewhat like : "returns a highlighted fragment from"
Is it possible to get the starting and ending index of this fragment in the text above (say starting is 10 and ending is 45)
© Stack Overflow or respective owner