lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Jelsma <>
Subject Highlighter IOOBE with modified HyphenationCompoundWordTokenFilter
Date Thu, 04 Oct 2012 13:41:16 GMT

I've modified the HyphenationCompoundWordTokenFilter to emit less subtokens because the original
filter can emit all kinds of subtokens that have a very different meaning on their own. I've
modified it so no overlapping subtokens are emitted and no subtokens are emitted that can
be found within another subtoken. I've also modified it to force that the generated subtokens
comprise the original token and if they don't forget the subtokens. It also doesn't return
the original token anymore, the original filter produces a duplicate of the original input
token. For example: verzekeringmaatschappij now becomes verzekering and maatschappij and not
verzekeringmaatschappij, ver, zeker, verzeker, zekering, ringmaat, maat and more.

But it seem that i have done something wrong because my modified version sometimes causes
the Highlighter to throw the following IOOBE:

java.lang.StringIndexOutOfBoundsException: String index out of range: -14
        at java.lang.String.substring(
        at org.apache.solr.highlight.DefaultSolrHighlighter.doHighlightingByFastVectorHighlighter(
        at org.apache.solr.highlight.DefaultSolrHighlighter.doHighlighting(
        at org.apache.solr.handler.component.HighlightComponent.process(
        at org.apache.solr.handler.component.SearchHandler.handleRequestBody(
        at org.apache.solr.handler.RequestHandlerBase.handleRequest(
        at org.apache.solr.core.SolrCore.execute(
        at org.apache.solr.servlet.SolrDispatchFilter.execute(
        at org.apache.solr.servlet.SolrDispatchFilter.doFilter(
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(

Anyone to point me in the right direction? I've checked the LIA book on how to manipulate
the tokenstream and thought it should be alright. My analysis tests also yield good results,
nothing strange to be found. Or could it be an error in the highlighter that only now shows


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message