问题
solr/
├── bin/
├── CHANGES.TXT
├── contrib/
├── dist/
├── docs/
├── example/
├── licenses
............
├── server/
└── tempfolder/
└── index.html
I have following folder structure and my solr version is 8.6.3. When I enter command:
bin/post -c solrhelp -filetypes html tempfolder/
I get following error:
Solr returned an error #404 (Not Found) for url: http://localhost:8983/solr/solrhelp/update/extract?resource.name=/home/user/solr-8.6.3/example/my-examples/index.html&literal.id=/home/user/solr-8.6.3/example/my-examples/index.html
But in solr-8.3.1 this command works fine. Does solr-8.6.3 supports html file indexing? If yes how to do it?
回答1:
You have to enable the ExtractingRequestHandler and configure it for /extract
to be available. This was probably already done in your old installation.
If you are not working with an example configset, the jars required to use Solr Cell will not be loaded automatically. You will need to configure your solrconfig.xml to find the ExtractingRequestHandler and its dependencies:
<lib dir="${solr.install.dir:../../..}/contrib/extraction/lib" regex=".*\.jar" /> <lib dir="${solr.install.dir:../../..}/dist/" regex="solr-cell-\d.*\.jar" />
You can then configure the ExtractingRequestHandler in solrconfig.xml. The following is the default configuration found in Solr’s _default configset, which you can modify as needed:
<requestHandler name="/update/extract" startup="lazy" class="solr.extraction.ExtractingRequestHandler" > <lst name="defaults"> <str name="lowernames">true</str> <str name="fmap.content">_text_</str> </lst> </requestHandler>
来源:https://stackoverflow.com/questions/64659922/solr-8-6-3-could-not-index-html-file