lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bin Lan <>
Subject Highlighter throws ClassCastException TextFragment cannot be cast to DocumentFragment
Date Thu, 27 Dec 2012 20:39:45 GMT
We have a section of code that does the text highlight, it was running fine
under lucene 1.9.1, but we are getting the following error after upgrade to
3.6.1. It does not seem to be anything that we have control of. any body
have any suggestion on how to fix this?

Exception while trying to select search results
Caused by:
java.lang.ClassCastException: cannot be cast to

We call getBestSegments as following:

String[] fragments = highlighter.getBestFragments( analyzer, "Message",
message, mf );

Bin Lan
Software Developer
Perimeter E-Security
O - (203)541-3412

Follow Us on Twitter:
Read Our Blog:

This message is for the sole use of the intended recipient(s) and may contain confidential
and/or privileged information of Perimeter Internetworking Corp.  Any unauthorized review,
use, copying, disclosure, or distribution is prohibited.  If you are not the intended recipient,
please immediately contact the sender by reply email and delete all copies of the original

 The sender of this email subscribes to Perimeter E-Security's email
 anti-virus service. This email has been scanned for malicious code and is
 believed to be virus free. For more information on email security please
 This communication is confidential, intended only for the named recipient(s)
 above and may contain trade secrets or other information that is exempt from
 disclosure under applicable law. Any use, dissemination, distribution or
 copying of this communication by anyone other than the named recipient(s) is
 strictly prohibited. If you have received this communication in error, please
 delete the email and immediately notify our Command Center at 203-541-3444.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message