from datetime import datetime
from elasticsearch import Elasticsearch
es = Elasticsearch()
es.index(index=””, doc_type=””, id=, body={})
es.get(index=””,doc_type=””,id=)[‘source’]
#忽略400错误
es.indices.create(index=’text-index’, ignore=400)
es.cluster.health(,request_timeout=)
es.search(index=””, filter_path=[‘hits.hits._id’, ‘hits.hits._type’])
仅仅返回 id type字段
常用操作
create
delete
get
update
search
elasticsearch.Elasticsearch(hosts=,transport_class=,)
attr
cat
cluster
indices
ingest
nodes
snapshot
tasks
method
bulk()
body,index,doc_type,_source,_source_exclude,_source_include,fields,pipeline,refresh,routing,timeout,wait_for_active_shards
clear_scroll()
scroll_id, body
count()
index,doc_type,body,allow_no_indices,analyze_wildcard,analyzer,default_operator,df,expand_wildcards,ignore_unavailable,lenient,min_score,preference,q,routing
create()
index,doc_type,id,body,parent,pipeline,refresh,routing,timeout,timestamp,ttl,version,version_type,wait_for_active_shards
delete()
index,doc_type,id,parent,refresh,routing,timeout,version,version_type,wait_for_active_shards
delete_by_query()
index,body,doc_type,_source,_source_exclude,_source_include,allow_no_indices,analyze_wildcard,analyzer,conflicts,default_operator,df,expand_wildcards,from,ignore_unavailable,lenient,preference,q,refresh,request_cache,requests_per_second,routing,scroll,scroll_size,search_timeout,search_type,size,slices,sort,stats,terminate_after,timeout,version,wait_for_active_shards,wait_for_completion
delete_script()
id
exists()
index,doc_type,id,_source,_source_exclude,_source_include,parent,preference,realtime,refresh,routing,stored_fields,version,version_type
exists_source()
index,doc_type,id,_source,_source_exclude,_source_include,parent,preference,realtime,refresh,routing,version,version_type
explain()
index,doc_type,id,body,_source,_source_exclude._source_include,analyze_wildcard,analyzer,default_operator,df,lenient,parent,preference,q,routing,stored_fields
field_caps()
index,body,allow_no_indices,expand_wildcars,fields,ignore_unavailable
get()
index,doc_type,id,_source,_source_exclude,_source_include,parent,preference,realtime,refresh,routing,stored_fields,version,version_type
get_script()
id
get_source()
index,doc_type,id,_source,_source_exclude,_source_include,parent,preference,realtime,refresh,routing,version,version_type
get_template()
id
index()
index,doc_type,body,id,op_type,parent,pipeline,refresh,routing,timeout,timestamp,ttl,version,version_type,wait_for_active_shards
info()
mget()
body,index,doc_type,_source,..
msearch()
body,index,doc_type,max_concurrent_searches,pre_filter_shard_size,search_type,typed_keys
msearch_template()
body,index,doc_type,…
ping()
put_script()
id,body
put_template()
id,body
reindex()
body,refresh,requests_per_second,slices,timeout,wait_for_active_shards,wait_for_completion
render_search_template()
id,body
scroll()
scroll_id,body,scroll
search()
index,doc_type,body,_source,_source_exclude,_source_include,_allow_no_indices,analyzer_wildcard,analyzer,batched_reduce_size,default_operator,df,docvalue_fields,expand_wildcards,explain,from,ignore_unavailable,lenient,max_concurre_shard_requests,pre_filter_shard_size,preference,q,request_cache,routing,scroll,search_type,size,sort,stats,stored_fields,suggest_field,suggest_mode,suggest_size,suggest_text,terminate_after,timeout,track_scores,track_total_hits,typed_keys,version
search_shards()
search_template()
termvectors()
update()
index,doc_type,id,body,_source,_source_exclude,_source_include,fields,lang,parent,refresh,retry_on_conflict,routing,timeout,timestamp,ttl,version,version_type,wait_for_active_shards
update_by_query()
分类: 搜索

0 条评论

发表回复

Avatar placeholder

您的电子邮箱地址不会被公开。