elasticsearch批量index,update,delete——Bulk Helpers
来源:互联网 发布:贪心算法的基本思想 编辑:程序博客网 时间:2024/05/22 23:29
1. 批量建索引
for i in range(0,1000):
newDic = {"key":"value"}
action = {"_index": IndexName, "_type": TypeName, "_id": _id, "_source": newDic}
actions.append(action)
#--------------bukl index actions
if len(actions)>0:
finished = False
while not finished:
try:
# bulk create index
helpers.bulk(es, actions, chunk_size=1000, request_timeout=30)
finished = True
except ConnectionTimeout:
s = traceback.format_exc()
print s
del actions[:]
2. 批量删除
action = {
'_op_type': 'delete',
'_index': 'index-name',
'_type': 'document',
'_id': 42,
}
actions.append(action)
3. 批量更新
action = {
'_op_type': 'update',
'_index': 'index-name',
'_type': 'document',
'_id': 42,
'doc': {'question': 'The life, universe and everything.'}
}
actions.append(action)
- elasticsearch批量index,update,delete——Bulk Helpers
- 分布式搜索引擎elasticsearch PHP API index bulk 批量插入操作
- elasticSearch批量操作bulk
- elasticsearch之批量提交Bulk
- Elasticsearch bulk批量增删改
- Elasticsearch Java API 的使用(9)—Bulk大数据量的批量上传
- 批量绑定—BULK COLLECT
- Elasticsearch的javaAPI之get,delete,bulk
- ElasticSearch提供的bulk update性能对比
- elasticsearch 批量入库bulk性能测试
- Elasticsearch java api(五) Bulk批量索引
- Elasticsearch java api(五) Bulk批量索引
- Elasticsearch java api(五) Bulk批量索引
- Elasticsearch java api中Bulk批量索引
- Elasticsearch java api(五) Bulk批量索引
- elasticsearch bulk 批量加载索引的实例
- oracle批量update和delete
- mybatis批量update,insert,delete
- C语言实现两台电脑通过串口通信
- leetcode/258. Add Digits
- hdoj 1025 Constructing Roads In JGShining's Kingdom ( LIS +二分法STL )
- iOS开发 pod install遇到的问题If none exists, create a ticket, with the template displayed above
- 曼哈顿距离最小生成树与莫队算法
- elasticsearch批量index,update,delete——Bulk Helpers
- warning C4018: “<”: 有符号/无符号不匹配
- mysql问题解决:mysqladmin: connect to server at 'localhost' failed
- [Java]Socket和ServerSocket学习
- Spring MVC 学习笔记 四 Viewresol和View
- property介绍
- Spring MVC 学习笔记 五 controller与requestmapping
- 【JAVA语言程序设计基础篇】--图形--使用FontMetrics类居中显示字符串
- 输出异常