在尝试在 Windows x64 计算机上设置 SOLR 时,我不断收到错误 “无法找到或加载主类 org.apache.solr.util.SolrCLI”。
问题的解决其实很简单。 1)启动solr。请注意,您必须使用 solr.cmd 而不仅仅是 solr
*bin/solr.cmd start*
2)然后创建集合:
*bin/solr.cmd create -c gettingstarted -p 8983*
3) 然后使用发布工具将文件添加到索引。您可以通过两种方式执行 post 命令
a)
java -Dc=gettingstarted -jar post.jar *.json
或
b)
bin/post -c gettingstarted example/exampledocs/books.json
现在您可以导航到新创建的收藏“入门”并查询您的书籍。
`http://localhost:8983/solr/#/gettingstarted/query'
希望这可以节省某人的时间。
使用以下命令之一将数据导入核心:
Windows:
bin\solr post -url http://localhost:8983/solr/tech_products/update example\exampledocs\*.xml
MacOS/Linux
bin/solr post -url http://localhost:8983/solr/tech_products/update example/exampledocs/*.xml