我在一个SQS队列中存储了大量json格式的json数据。我有一个python脚本,它基本上从SQS中提取数据,然后将其索引到ES。代码片段如下所示:
doc = {
"settings" : {
"number_of_shards" : 1
},
"mappings" : {
"_default_":{
"_timestamp" : {
"enabled" : 'true',
"store" : 'true'
}
}
}
}
es = Elasticsearch()
h = { "Content-type":"application/json" }
res = requests.request("POST","http://localhost:9200/"+index_name+"/",headers=h,data=json.dumps(doc))
post = es.index(index=index_name , doc_type='server' , id =1 , body=json.dumps(new_list))
所以基本上我的搜索不是很有效,我读到了https://www.elastic.co/guide/en/elasticsearch/guide/current/aggregations-and-analysis.html,我基本上想确保ES不会把我的数据对象分成更小的块。我该怎么做才能解决这个问题?在
如果希望索引中的每个
string
字段都成为not analyzed
字符串,则需要使用Dynamic templates。在相关问题 更多 >
编程相关推荐