html tool

2019年6月25日星期二

python Elasticsearch put

参考: https://elasticsearch-py.readthedocs.io/en/master/api.html#elasticsearch.Elasticsearch.index



index(**kwargs
Adds or updates a typed JSON document in a specific index, making it searchable.http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html
Parameters:
  • index – The name of the index
  • body – The document  
  • id – Document ID   [popexizhi: 这里自己用的版本id 是默认值None,但后面的doc_type 可以没有默认值的,并且顺序不一样,
     284     def index(self, index, doc_type, body, id=None, params=None):
    vi  python2.7/site-packages/elasticsearch/client/__init__.py
    
    ]
  • doc_type – Document type, defaults to _doc. Not used on ES 7 clusters.
  • op_type – Explicit operation type, default ‘index’, valid choices are: ‘index’, ‘create’
  • parent – ID of the parent document
  • pipeline – The pipeline id to preprocess incoming documents with
  • refresh – If true then refresh the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false (the default) then do nothing with refreshes., valid choices are: ‘true’, ‘false’, ‘wait_for’
  • routing – Specific routing value
  • timeout – Explicit operation timeout
  • timestamp – Explicit timestamp for the document
  • ttl – Expiration time for the document
  • version – Explicit version number for concurrency control
  • version_type – Specific version type, valid choices are: ‘internal’, ‘external’, ‘external_gte’, ‘force’
  • wait_for_active_shards – Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to all for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)

没有评论:

发表评论