Apache Nutch 爬蟲中的 Solr 索引

Apache Nutch 爬蟲中的 Solr 索引

我正在使用 Apache Nutch 爬蟲並遵循中提到的指南https://wiki.apache.org/nutch/NutchTutorial。但是當我建立索引時,出現瞭如下錯誤。

分段目錄已完成:crawl/segments/2xxxxxxxxxxxxx。

-filer 處的輸入路徑不是一個段...正在跳過

索引器:開始於 2019-04-02 14:16:21

索引器:刪除消失的文件:true

索引器:URL 過濾:false

索引器:URL 規範化:true

未配置交換。這些文件將被傳送給所有索引編寫者。

Active IndexWriters:SOLRIndexWriter type:伺服器的類型。可以是:「cloud」、「concurrent」、「http」或「lb」 url:SOLR 實例的URL 或Zookeeper 仲裁的URL commitSize:傳送到SOLR 時的緩衝區大小(預設1000) auth:使用身份驗證(預設false ) 使用者名稱 : 認證使用者名稱 密碼 : 認證密碼

索引1/1 個文件刪除0 個文件索引作業未成功,作業狀態:FAILED,原因:NA 索引器:java.lang.RuntimeException:索引作業未成功,作業狀態:FAILED,原因:NA at org.apache. nutch .indexer.IndexingJob.index(IndexingJob.java:152) 在org.apache.nutch.indexer.IndexingJob.run(IndexingJob.java:235) 在org.apache.hadoop.util.ToolRunner.run(ToolRunner.java: 70 )在 org.apache.nutch.indexer.IndexingJob.main(IndexingJob.java:244)

我該如何解決這個問題?

答案1

如果您在 solr.log 中看到 This IndexSchema is not mutable. ,則在 solrconfig.xml 中將 true 替換為 false

<updateRequestProcessorChain name="add-unknown-fields-to-the-schema" default="${update.autoCreateFields:false}"
           processor="uuid,remove-blank,field-name-mutating,parse-boolean,parse-long,parse-double,parse-date,add-schema-fields">

然後它可能會起作用,或者至少在 solr.log 中會有更多信息

答案2

我遇到了同樣的問題,並發現在 Solr 中,名為“nutch”的核心未映射,因此我從 Solr > Core admin 創建了一個名為“nutch”的新核心(http://localhost:8983/solr/#/)(創建了一個名為 nutch 的新資料夾並複製了架構檔案)並且它起作用了。

相關內容