【发布时间】:2021-06-22 06:29:38
【问题描述】:
我正在 python3 中编写 python 代码以从 apache solr 获取值。当查询中的日期被硬编码时,该代码运行良好。我想通过在变量中定义日期来传递日期。
这很好用:
query='http://x.x.x.x:8983/solr/test/select?fq=timestamp:%5b2020-10-01T00:00:00.000Z%20TO%202020-10-31T23:59:59.999Z%5d&q=*:*'
预期:
query='http://x.x.x.x:8983/solr/test/select?fq=timestamp:%5b'first_dayT00:00:00.000Z%20TO%20'last_day'T23:59:59.999Z%5d&q=*:*'
first_day = "2020-10-01"
last_day = "2020-10-31"
预期的查询有什么问题?
【问题讨论】:
标签: python python-3.x solr