2
我已經將solr 4.3.1作爲7.1.1在jboss上運行。 我試圖索引簡單的XML文件solr 4.3.1使用DataImportHandler索引一個xml文件
<add>
<doc>
<field name="fname">test1</field>
<field name="number">1</field>
</doc>
</add>
這個文件的test.xml,並在C:\ Solr的輸入\的test.xml
這裏是我的數據-config.xml中
<dataConfig>
<dataSource type="FileDataSource" encoding="UTF-8" />
<document>
<entity name="page" processor="XPathEntityProcessor" stream="true" forEach="/doc" url="C:\solr-input\test.xml" transformer="RegexTransformer,DateFormatTransformer">
<field column="name" xpath="/add/doc/field[@name='fname']" indexed="true" />
<field column="number" xpath="/add/doc/field[@name='number']" indexed="true" />
</entity>
</document>
</dataConfig>
,它是在文件夾中的JBoss /獨立/部署/ Solr的/ collection1/conf目錄
和結束時,這裏是我所附加的代碼solrconfig.xml中
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">data-config.xml</str>
</lst>
</requestHandler>
所以,當我運行的URL
<http://localhost:8080/solr/dataimport?command=full-import>
它說我
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">19</int>
</lst>
<lst name="initArgs">
<lst name="defaults">
<str name="config">data-config.xml</str>
</lst>
</lst>
<str name="command">full-import</str>
<str name="status">idle</str>
<str name="importResponse"/>
<lst name="statusMessages">
<str name="Total Requests made to DataSource">0</str>
<str name="Total Rows Fetched">0</str>
<str name="Total Documents Skipped">0</str>
<str name="Full Dump Started">2013-06-21 12:25:03</str>
<str name="">
Indexing completed. Added/Updated: 0 documents. Deleted 0 documents.
</str>
<str name="Committed">2013-06-21 12:25:04</str>
<str name="Total Documents Processed">0</str>
<str name="Time taken">0:0:0.148</str>
</lst>
<str name="WARNING">
This response format is experimental. It is likely to change in the future.
</str>
</response>
,如果我去
<http://localhost:8080/solr/collection1/select?q=test1&wt=xml&indent=true>
它不顯示我的任何結果...
我做錯了什麼?
你犯了嗎? – JHS
是的,我已經承諾與提交=真,但已經沒有什麼 – Mathx64
你有沒有試圖在data-config.xml中使用關於url的反斜槓轉義?類似於url =「C:\\ solr-input \\ test.xml」? – leoh