为多核设置 solr(可能相关也可能不相关)后,我有了一个工作测试系统。除了以下几行之外,solrconfig.xml
居住在其中并且看起来基本上类似于多核的示例 solrconfig 文件:/solr-4.4.0/example/multicore/expertise/conf
<dataDir>/data/website_data/solr_cores/expertise</dataDir>
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">/data/website_data/solr_cores/expertise/data-config.xml</str>
</lst>
</requestHandler>
因为我想要一个支持语言的 solr,所以我用一些选择处理程序(以前handleSelect
是true
)和一个新的updateRequestProcessorChain
. 对 solrconf.xml 的更改如下所示:
<lib dir="${user.dir}/../contrib/analysis-extras/lucene-libs/" /><!-- relative to solrs 'example' directory -->
<lib dir="${user.dir}/../contrib/analysis-extras/lib/" />
<lib dir="${user.dir}/../dist/" regex="solr-langid-.*\.jar" />
<lib dir="${user.dir}/../contrib/langid/lib/" />
<!-- required for language detection of input records -->
<updateRequestProcessorChain name="languages">
<processor class="solr.LangDetectLanguageIdentifierUpdateProcessorFactory">
<lst name="invariants">
<str name="langid.fl">focus, expertise, platforms, partners, participation, additional</str>
<str name="langid.whitelist">en,fr</str>
<str name="langid.fallback">en</str>
<str name="langid.langField">detectedlang</str>
<bool name="langid.map">true</bool>
<bool name="langid.map.keepOrig">false</bool>
</lst>
</processor>
<processor class="solr.RunUpdateProcessorFactory" />
</updateRequestProcessorChain>
<!-- uses language-detecting update.chain -->
<requestHandler name="/update" class="solr.UpdateRequestHandler">
<lst name="invariants">
<str name="update.chain">languages</str>
</lst>
</requestHandler>
<requestDispatcher handleSelect="false"> <!-- ORIGINALLY FALSE -->
<requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="2048" formdataUploadLimitInKB="2048" />
<httpCaching never304="true" />
</requestDispatcher>
<requestHandler name="/select" class="solr.SearchHandler">
<lst name="defaults">
<str name="defType">edismax</str>
<str name="qf">focus^2, expertise^2, platforms, partners, participation, additional</str><!-- default query looks in these fields, with these boosts -->
<str name="f.focus.qf">focus_en focus_fr</str><!-- field alias 'focus' means en AND fr versions of focus -->
<str name="f.expertise.qf">expertise_en expertise_fr</str>
<str name="f.platforms.qf">platforms_en platforms_fr</str>
<str name="f.partners.qf">partners_en partners_fr</str>
<str name="f.participation.qf">participation_en participation_fr</str>
<str name="f.additional.qf">additional_en additional_fr</str>
</lst>
</requestHandler>
<requestHandler name="/selectEN" class="solr.SearchHandler">
<lst name="defaults">
<str name="defType">edismax</str>
<str name="qf">focus^2, expertise^2, platforms, partners, participation, additional</str>
</lst>
<lst name="invariants">
<str name="fq">detectedlang:en</str>
<str name="f.focus.qf">focus_en</str>
<str name="f.expertise.qf">expertise_en</str>
<str name="f.platforms.qf">platforms_en</str>
<str name="f.partners.qf">partners_en</str>
<str name="f.participation.qf">participation_en</str>
<str name="f.additional.qf">additional_en</str>
<str name="uf">* -focus_* -expertise_* -platforms_* -partners_* -participation_* -additional_*</str><!-- direct query any field except language-defined ones -->
<str name="fl">*,focus:focus_en, expertise:expertise_en, platforms:platforms_en, partners:partners_en,
participation:participation_en, additional:additional_en</str><!-- return lang-defined field when asked for generic field -->
</lst>
</requestHandler>
<requestHandler name="/selectFR" class="solr.SearchHandler">
<lst name="defaults">
<str name="defType">edismax</str>
<str name="qf">focus^2, expertise^2, platforms, partners, participation, additional</str>
</lst>
<lst name="invariants">
<str name="fq">detectedlang:fr</str>
<str name="f.focus.qf">focus_fr</str>
<str name="f.expertise.qf">expertise_fr</str>
<str name="f.platforms.qf">platforms_fr</str>
<str name="f.partners.qf">partners_fr</str>
<str name="f.participation.qf">participation_fr</str>
<str name="f.additional.qf">additional_fr</str>
<str name="uf">* -focus_* -expertise_* -platforms_* -partners_* -participation_* -additional_*</str><!-- direct query any field except language-defined ones -->
<str name="fl">*,focus:focus_fr, expertise:expertise_fr, platforms:platforms_fr, partners:partners_fr,
participation:participation_fr, additional:additional_fr</str><!-- return lang-defined field when asked for generic field -->
</lst>
</requestHandler>
现在我得到错误:
Can't find resource '/data-config.xml' in classpath or 'multicore/expertise/conf/', cwd=/solr-4.4.0/example</str>
数据路径没有改变。data-config.xml 文件存在于它应该存在的位置,并且它的权限是正确的。为什么我原来的 solrconf.xml 可以找到 data-config.xml 而我的新的却找不到?