【问题标题】:How to perform delta-import in solr with authentication?如何通过身份验证在 solr 中执行增量导入?
【发布时间】:2026-02-07 16:30:01
【问题描述】:

我已经完成了 solr 的完全导入,现在我必须使用 linux-cron 来自动化 delta-import。这是我的 shell 脚本:

#!/bin/bash
curl http://localhost:8983/solr/collection/dataimport?command=delta-import

我服务器中的 solr 受身份验证保护。那么如何进行身份验证,然后使用 curl 进行增量导入?

【问题讨论】:

    标签: shell curl solr


    【解决方案1】:

    使用标准HTTP语法for basic authentication

    curl http://user:pass@localhost:8983/solr/..
    

    【讨论】:

    • 完整查询是 curl http:/user:pass@/localhost:8983/solr//dataimport?command=delta-import&clean=false&commit=true