测试代码1:

def test(self):
data = {"add": {"doc": {"id": "100001", "*字段名*": u"我是一个大好人"}}}
params = {"boost": 1.0, "overwrite": "true", "commitWithin": 1000}
url = 'http://127.0.0.1:8983/solr/mycore/update?wt=json'
headers = {"Content-Type": "application/json"}
r = requests.post(url, json=data, params=params, headers=headers)
print r.text
def Index_data(self):
solr = pysolr.Solr('http://127.0.0.1:8983/solr/mycore/', timeout=10)
# How you'd index data.
result = solr.add([
{
"id": "doc_1",
"title": "A test document",
},
{
"id": "doc_2",
"title": "The Banana: Tasty or Dangerous?",
},
])
print result

售后响应及时
7×24小时客服热线
数据备份
更安全、更高效、更稳定
价格公道精准
项目经理精准报价不弄虚作假
合作无风险
重合同讲信誉,无效全额退款