lucene3.5高亮显示报错

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/lucene/index/memory/MemoryIndex
	at org.apache.lucene.search.highlight.WeightedSpanTermExtractor$FakeReader.<clinit>(WeightedSpanTermExtractor.java:559)
	at org.apache.lucene.search.highlight.WeightedSpanTermExtractor.extract(WeightedSpanTermExtractor.java:154)
	at org.apache.lucene.search.highlight.WeightedSpanTermExtractor.getWeightedSpanTerms(WeightedSpanTermExtractor.java:385)
	at org.apache.lucene.search.highlight.QueryScorer.initExtractor(QueryScorer.java:217)
	at org.apache.lucene.search.highlight.QueryScorer.init(QueryScorer.java:185)
	at org.apache.lucene.search.highlight.Highlighter.getBestTextFragments(Highlighter.java:205)
	at org.apache.lucene.search.highlight.Highlighter.getBestFragments(Highlighter.java:158)
	at org.apache.lucene.search.highlight.Highlighter.getBestFragment(Highlighter.java:104)
	at com.wlh.lucene.test2.HighlighterDemo.toHighlighter(HighlighterDemo.java:23)
	at com.wlh.lucene.test2.MyQuerys.querySearcherByPage(MyQuerys.java:104)
	at com.wlh.lucene.test2.MyQuerys.main(MyQuerys.java:160)

错误原因:
无法找到MemoryIndex类
解决办法:将\lucene-3.5.0\lucene-3.5.0\contrib\memory\目录下的lucene-memory-3.5.0.jar加入到lib目录下。

你可能感兴趣的:(exception,Lucene)