[英]Solr-Tika integration Indexing file
I was following this link to index files in Solr. 我正在跟踪指向 Solr中索引文件的链接 。 I created a folder in Solr folder, then created my folder named "easy", then created conf folder. 我在Solr文件夹中创建了一个文件夹,然后创建了名为“ easy”的文件夹,然后创建了conf文件夹。 Inside conf folder, I created schema.xml and wrote this inside of it : 在conf文件夹中,我创建了schema.xml并将其写在其中:
<field name="content" type="text" indexed="true" stored="true" multiValued="true"/>
After that, I created solrconfig.xml then wrote those codes : 之后,我创建了solrconfig.xml,然后编写了这些代码:
<requestHandler name="/dataimport">
<lst name="defaults">
<str name="config">data-config.xml</str>
</lst>
</requestHandler>
<lib dir="../../dist/" regex="apache-solr-dataimporthandler-.*\.jar" />
After that, created data-config.xml then wrote those codes: 之后,创建的data-config.xml然后编写以下代码:
<dataConfig>
<script><![CDATA[
id = 1;
function GenerateId(row) {
row.put('id', (id ++).toFixed());
return row;
}
]]></script>
<dataSource type="BinURLDataSource" name="data"/>
<dataSource type="URLDataSource" baseUrl="http://localhost/tmp/bin/" name="main"/>
<document>
<entity name="rec" processor="XPathEntityProcessor" url="data.xml" forEach="/albums/album" dataSource="main" transformer="script:GenerateId">
<field column="title" xpath="//title" />
<field column="description" xpath="//description" />
<entity processor="TikaEntityProcessor" url="http://localhost/tmp/bin/${rec.description}" dataSource="data">
<field column="text" name="content" />
<field column="Author" name="author" meta="true" />
<field column="title" name="title" meta="true" />
</entity>
</entity>
</document>
</dataConfig>
Then I ran solr server and an error occured 然后我运行了solr服务器,发生了错误
easy: org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Could not load conf for core easy: Error loading solr config from /home/alican/Downloads/solr-4.10.2/example/solr/test/easy/conf/solrconfig.xml 容易:org.apache.solr.common.SolrException:org.apache.solr.common.SolrException:无法为核心加载conf容易:从/home/alican/Downloads/solr-4.10.2/example/加载错误的solr配置Solr的/测试/易/ conf目录/ solrconfig.xml中
What part am I missing according to the link which l am following ? 根据我关注的链接,我缺少哪一部分?
Second question about the lib 关于库的第二个问题
<lib dir="../../dist/" regex="apache-solr-dataimporthandler-.*\.jar" />
Do I need to change "../../dist/ ? What path is it ? 我需要更改“ ../../dist/吗?这是什么路径?
-- I removed that lib part from solrconfig.xml and restarted server. -我从solrconfig.xml中删除了该lib部分,然后重新启动了服务器。 Error was still occuring. 仍然发生错误。
The error says the its not able to load sorconfig.xml. 该错误表明其无法加载sorconfig.xml。 Check if you have added the solrConfig.xml in the conf folder. 检查是否在conf文件夹中添加了solrConfig.xml。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.