Solr 8.4.1 云:bin/post - 找不到文件问题

Solr 8.4.1 cloud : bin/post - File not Found problem

我是Solr新手,一直在学习8.4.0的教程。在使用 SolrCloud 成功遵循 techproducts 示例之后,我现在正在尝试使用无模式方法来索引一些 PDF 文件。为此,我再次使用教程中的以下内容来索引存储在 ~/Documents/pdf 文件夹中的几个文件:

bin/solr create -c localpdf -s 2 - rf 2
bin/post -c localpdf ~/Documents/pdf

执行上述时,出现以下错误:

SimplePostTool: WARNING: Response: <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 404 Not Found</title>

</head>
<body><h2>HTTP ERROR 404</h2>
<p>Problem accessing /solr/localpdf/update/extract. Reason:
<pre>    Not Found</pre></p>
</body>
</html>
SimplePostTool: WARNING: IOException while reading response: java.io.FileNotFoundException: http://localhost:8983/solr/localpdf/update/extract?resource.name=%2Fhome%2Fuser%2FDocuments%2Fpdf%2Ftest234.pdf&literal.id=%2Fhome%2Fuser%2FDocuments%2Fpdf%2Ftest234.pdf

运行与techproducts相同的命令,即运行:

bin/post -c techproducts ~/Documents/pdf

至少找到了文件(它给了我一些与 PDFBox 和一些字体相关的其他错误,但这是另一回事)

我可以添加其他文件,例如 example/exampledocs 文件夹中的 XML 到 localpdf,但不能添加 pdf。

我在这里错过了什么?

您必须 configure your core / collection to load the extracting request handler - 否则无法使用。 techproducts 核心默认执行此操作。将罐子添加到要加载的罐子列表中:

<lib dir="${solr.install.dir:../../..}/contrib/extraction/lib" regex=".*\.jar" />
​<lib dir="${solr.install.dir:../../..}/dist/" regex="solr-cell-\d.*\.jar" />

并添加请求处理程序定义(来自上面链接的指南):

<requestHandler name="/update/extract" class="org.apache.solr.handler.extraction.ExtractingRequestHandler">
  <lst name="defaults">
    <str name="fmap.Last-Modified">last_modified</str>
    <str name="uprefix">ignored_</str>
  </lst>
  <!--Optional.  Specify a path to a tika configuration file. See the Tika docs for details.-->
  <str name="tika.config">/my/path/to/tika.config</str>
  <!-- Optional. Specify one or more date formats to parse. See DateUtil.DEFAULT_DATE_FORMATS
       for default date formats -->
  <lst name="date.formats">
    <str>yyyy-MM-dd</str>
  </lst>
  <!-- Optional. Specify an external file containing parser-specific properties.
       This file is located in the same directory as solrconfig.xml by default.-->
  <str name="parseContext.config">parseContext.xml</str>
</requestHandler>