I am stuck .I am using a Reader to extract the content of document and I woul开发者_如何转开发d like to highlight it in search time . How can I do that ? Someone can show some code please ?
thank you .
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.
精彩评论