Skip to content

Latest commit

 

History

History
28 lines (18 loc) · 1.32 KB

File metadata and controls

28 lines (18 loc) · 1.32 KB

pyelasticsearch

新手上路 ?? {: #getting-started }

  • A Taste of the API - pyelasticsearch — pyelasticsearch 1.4.1 documentation #ril
    • Make a pooling, balancing, all-singing, all-dancing CONNECTION OBJECT: 其中 pooling/balancing 指的是什麼??

      >>> from pyelasticsearch import ElasticSearch
      >>> es = ElasticSearch('http://localhost:9200/')
      
    • Index a document:

      >>> es.index('contacts', # index(index, doc_type, doc, id=None, ...)
      ...          'person',
      ...          {'name': 'Joe Tester', 'age': 25, 'title': 'QA Master'},
      ...           id=1)
      {u'_type': u'person', u'_id': u'1', u'ok': True, u'_version': 1, u'_index': u'contacts'}
      

參考資料 {: #reference }

文件: