对于从数据框索引的数据,如下所示:
import json
mycolumns = ['name']
df = pd.DataFrame(columns=mycolumns)
rows = [["John Abraham"],["Lincoln Smith"]]
for row in rows:
df.loc[len(df)] = row
print(df)
jsons = json.loads(df.to_json(orient='records'))
n = 0
for j in jsons:
j['injection_timestamp'] = pd.to_datetime('now')
es.index(index="prox", doc_type='record', body=j)
if n%1000==0:
print (n/1000),
n+=1
我正在尝试搜索两行上传播的match_phrase,如下所述: https://www.elastic.co/guide/en/elasticsearch/guide/current/_multivalue_fields_2.html#_multivalue_fields_2
es.search(index =“prox”,body = {“query”:{“match_phrase”:{“name”:“Abraham Lincoln”}}}) 由于数组索引的方式,我希望获得1分,但我没有得到任何打击。