Which of following is best way to query elasticsearch from python? -


Elasticsearch आयात से Elasticsearch es = Elasticsearch () का परिणाम

आधिकारिक लोचदार खोज अजगर क्लाइंट

  Es.get (index = "test_index", id = 1) प्रिंट (परिणाम)   

या

  आयात urllib2 आयात json प्रतिक्रिया = urllib2.urlopen ( 'Http: // localhost: 9200 / test_index / _search? Q = _id: 1',) परिणाम = json.loads (response.read ()) प्रिंट (परिणाम)   

इनमें से कौन सा ऊपर अजगर से लोचदार खोज करने का सबसे अच्छा तरीका है?

कुछ अजगर क्लाइंट हैं, आधिकारिक एक है शायद सबसे अधिक विश्वसनीय / संगत होने वाला है और अगर आपने देखा कि यह आपके 2 उदाहरण के समान होगा। यहां कुछ अन्य पायथन क्लाइंट हैं -

  1. elasticsearch
  2. पाइलीस्टिकसेर्च
  3. कच्चे

Comments

Popular posts from this blog

sql - Return Function using Cursor -

c++ - why does this code produce a runtime error? -

javascript - Is there any way to add a new parameter to a function programmatically? -