不使用网络将文档上传到solr?

时间:2015-09-18 20:16:23

标签: python solr

我需要能够加快上传到solr索引的速度。 在python中我使用以下内容:

for f in files:
    cmd = ('curl', '-s', \
        'http://localhost:8983/solr/core/update/json?commit=true', \
        '--data-binary', '@' + f, '-H', 'Content-type:application/json')
    call(cmd)

我需要将很多这些文件输入到这个索引中,而且速度非常慢。

我熟悉命令行中使用的post工具:

bin/post -c gettingstarted example/films/films.json

我考虑过使用系统调用,但文档提到此命令行方法在localhost:8983处联系服务器。我假设我不会用这种方法避免任何网络延迟,虽然我还没有尝试过。

我的python脚本中有更快的方法吗?

0 个答案:

没有答案