2

I am stuck .I am using a Reader to extract the content of document and I would like to highlight it in search time . How can I do that ? Someone can show some code please ?

thank you .

lemoos
  • 21
  • 2

1 Answers1

0

lemoos, Please see this question and Nick Hrycan's blog post. Note that this is highly version-dependent, so you will probably need to tweak this to your version of Lucene.

BTW, Solr has much simpler highlighting - if you have not invested a lot of time and effort in Lucene, you may consider switching to Solr.

Community
  • 1
  • 1
Yuval F
  • 20,565
  • 5
  • 44
  • 69