我在为示例数据建立索引时使用 solr 搜索我的应用程序。 但是当我使用
./post -c techproducts example/exampledocs/*.xml
我正在获取
java -classpath /home/s/Desktop/solr1/dist/solr-core-*.jar -Dauto=yes -Dc=techproducts -Ddata=files org.apache.solr.util.SimplePostTool example/exampledocs/gb18030-example.xml example/exampledocs/hd.xml example/exampledocs/ipod_other.xml example/exampledocs/ipod_video.xml example/exampledocs/manufacturers.xml example/exampledocs/mem.xml example/exampledocs/money.xml example/exampledocs/monitor2.xml example/exampledocs/monitor.xml example/exampledocs/mp500.xml example/exampledocs/sd500.xml example/exampledocs/solr.xml example/exampledocs/utf8-example.xml example/exampledocs/vidcard.xml
Error: Could not find or load main class org.apache.solr.util.SimplePostTool
谁能提出一些建议
最佳答案
您不能在类路径中使用这样的通配符。使用/home/s/Desktop/solr1/dist/* 或在类路径中显式列出所需的所有 .jar 文件。如果需要,还可以自动添加单独的 jar(我假设您使用的是 Linux):
CLASSPATH=`ls -1 /home/s/Desktop/solr1/dist/solr-core-*.jar | awk '{ ORS=":"; print; }'`
java -classpath $CLASSPATH ...
等等
关于java - 在 Solr 中索引数据以进行搜索,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30480080/