原先项目中使用MMSEG4J 1.73版本,对应lucene版本:
lucene: 2.9,高亮组件:lucene-highlighter-2.9.0.jar
mmseg4j : mmseg4j-all-1.7.3.jar
在使用lucene搜索时,很正常;
切换到 mmseg4j 1.80 后,在搜索时出现异常:
......
org.apache.lucene.search.highlight.InvalidTokenOffsetsException: Token 未知
exceeds length of provided text sized 2
at
org.apache.lucene.search.highlight.Highlighter.getBestTextFragments(Highlig
hter.java:254)
at
org.apache.lucene.search.highlight.Highlighter.getBestFragments(Highlighter
.java:184)
at
org.apache.lucene.search.highlight.Highlighter.getBestFragment(Highlighter.
java:107)
at
org.apache.lucene.search.highlight.Highlighter.getBestFragment(Highlighter.
java:85)
而把高亮组件切换成 lucene-highlighter-2.2.0.jar时(lucent
还是2.9,mmseg 为
1.80),报一下异常:
java.lang.StringIndexOutOfBoundsException: String index out of range: 3
at java.lang.String.substring(String.java:1934)
at
org.apache.lucene.search.highlight.Highlighter.getBestTextFragments(Highlig
hter.java:271)
at
org.apache.lucene.search.highlight.Highlighter.getBestFragments(Highlighter
.java:175)
at
org.apache.lucene.search.highlight.Highlighter.getBestFragment(Highlighter.
java:101)
at
org.apache.lucene.search.highlight.Highlighter.getBestFragment(Highlighter.
java:80)
两种情况下把只要把mmseg1.8 切换成 1.7.3 都可以运行正常。
暂时忙碌,无暇修改源代码。只是简单把问题反馈,因仓促��
�因,不知道是否已经说
清楚。
希望修改之。
Original issue reported on code.google.com by chenlb2...@gmail.com on 21 Oct 2009 at 3:08
Original issue reported on code.google.com by
chenlb2...@gmail.com
on 21 Oct 2009 at 3:08