使用Solr:参数列表发布命令错误太长

时间:2016-01-20 15:33:59

标签: post solr runtime-error

我尝试使用此命令将文档添加到我之前创建的特定核心:

./solr create -c kba_oct_2011

比使用curl实用程序

添加架构
curl http://localhost:8983/solr/kba_oct_2011/schema -X POST -H 'Content-type:application/json' --data-binary '{
    "add-field" : {
        "name":"title",
        "type":"text_general",
    "indexed":true,
        "stored":true
    },
    "add-field" : {
        "name":"description",
        "type":"text_general",
    "indexed":true,
        "stored":true
    },
    "add-field" : {
        "name":"date",
        "type":"date",
    "indexed":true,
        "stored":true
    }
}'

最后,我尝试使用post命令添加文档:

./post -c kba_oct_2011 /home/IPA/IPA_ws/Dataset_news_KBA/2011/10_October/*.xml

在目录/home/IPA/IPA_ws/Dataset_news_KBA/2011/10_October/中有72.420个文件,当我执行命令时出现此错误:

-bash: ./post: Argument list too long

有人可以帮助我吗?

谢谢!

1 个答案:

答案 0 :(得分:0)

这是因为扩展的参数列表扩展了命令行输入限制。 使用xargs为post命令提供参数列表。

相关问题