[Dspace-tech] ChineseAnalyzer not work in DSpace 4.0

3 views
Skip to first unread message

badboy

unread,
Aug 26, 2015, 12:58:29 PM8/26/15
to dspac...@lists.sourceforge.net
we install  DSpace4.0 on RHEL6.5, and set  the dspace.cfg  like this:
search.analyzer = org.apache.lucene.analysis.cn.ChineseAnalyzer

we meet the error when run #ant fresh_install
 FATAL org.dspace.search.DSIndexer @ anonymou s:no_context:no_search_analyzer:search.analyzer=org.apache.lucene.analysis.cn.Ch ineseAnalyzer 


in dspace.conf, if set
search.analyzer = org.apache.lucene.analysis.cn.ChineseAnalyzer

if will fail with #ant fresh-install .....

[java] 2012-05-09 17:02:18,195 ERROR org.dspace.search.DSIndexer @ Unable t
o create index directory: c:\dspace180/search
     [java] 2012-05-09 17:02:18,203 FATAL org.dspace.search.DSIndexer @ anonymou
s:no_context:no_search_analyzer:search.analyzer=org.apache.lucene.analysis.cn.Ch
ineseAnalyzer
     [java] java.lang.NoSuchMethodException: org.apache.lucene.analysis.cn.Chine
seAnalyzer.<init>(org.apache.lucene.util.Version)
     [java] at java.lang.Class.getConstructor0(Class.java:2706)
     [java] at java.lang.Class.getDeclaredConstructor(Class.java:1985)
     [java] at org.dspace.search.DSIndexer.getAnalyzer(DSIndexer.java:635)
     [java] at org.dspace.search.DSIndexer.openIndex(DSIndexer.java:914)
     [java] at org.dspace.search.DSIndexer.<clinit>(DSIndexer.java:225)
     [java] java.lang.ExceptionInInitializerError
     [java] Caused by: java.lang.IllegalStateException: java.lang.NoSuchMethodEx
ception: org.apache.lucene.analysis.cn.ChineseAnalyzer.<init>(org.apache.lucene.
util.Version)
     [java] at org.dspace.search.DSIndexer.getAnalyzer(DSIndexer.java:644)
     [java] at org.dspace.search.DSIndexer.openIndex(DSIndexer.java:914)
     [java] at org.dspace.search.DSIndexer.<clinit>(DSIndexer.java:225)
     [java] Could not find the main class: org.dspace.search.DSIndexer. Program
 will exit.
     [java] Exception in thread "main"

If I don't set .ChineseAnalyzer before install, ant build successful, and then I edit the dspace.conf
set it to use ChineseAnalyzer, same error message will got when use #dspace index-init 

--
How to do this?

Thanks  in advance!
Regarts.
Chenhe


SUZUKI Keiji

unread,
Aug 26, 2015, 12:58:30 PM8/26/15
to badboy, dspace tech
Hi Chenhe,

DSpace 4.0 uses Lucene 4.4.0. The ChineseAnalyser packaged in this version
does not have a method with the signature of init(Version), so this
error occurs.

According to the api document of ChineseAnalyser, this class is deprecated
and using "org.apache.lucene.analysis.standard.StandardAnalyzer", which has
the same functionality, is recommended instead.

How about trying this class as the value of "search.analyzer" property?

Regards,
Keiji Suzuki
> ------------------------------------------------------------------------------
> Flow-based real-time traffic analytics software. Cisco certified tool.
> Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
> Customize your own dashboards, set traffic alerts and generate reports.
> Network behavioral analysis & security monitoring. All-in-one tool.
> http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
> _______________________________________________
> DSpace-tech mailing list
> DSpac...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/dspace-tech
> List Etiquette:
> https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette



--
鈴木敬二@江別市

badboy

unread,
Aug 26, 2015, 12:58:38 PM8/26/15
to SUZUKI Keiji, dspace tech
yes, we will trying it, thank you very much!
--
¤╭⌒╮ ╭⌒╮ 相识也是缘份;
  ╱◥███◣ ╭⌒╮再见亦是朋友。
  ︱田︱田 田| ╰-------------
  ╬╬╬╬╬╬╬╬╬╬╬╬╬╬
Reply all
Reply to author
Forward
0 new messages