Elastic search client for Python: tip?

I am writing several scripts for our sellers to query an index using flexible search through python. (In the end, the script will update the leading position information in our Salesforce database.)

I used the urllib2 module using simplejson to pull the results. The problem is that this is apparently not a very good approach, as evidenced by scripts that take longer and take longer.

Questions:

  • Does anyone have any opinions (opinions on the Internet ???) about Elastic Search for Python? In particular, I found pyes and pyelasticsearch through elasticsearch.org --- how are these two stacks?

  • How good or bad is my current approach to dynamically building a query and running it through self.raw_results = simplejson.load(urllib2.urlopen(self.query)) ?

Any advice is appreciated!

+4
source share
2 answers

We use pyes. And it's pretty neat. You can go with a thrift protocol that is faster than other services.

+2
source

It looks like you have a non-client problem. If you can get rid of what is being sent to ES and present it in a simple curl command, it will do what actually works slower. I suspect that we just need to tweak your request to make sure it is optimal for your context.

0
source

All Articles