Giter VIP home page Giter VIP logo

esprit's Introduction

esprit: ElasticSearch - Put Records In There!

A python ElasticSearch toolbox.

esprit's People

Contributors

richard-jones avatar steven-eardley avatar emanuil-tolev avatar

Watchers

Alex Dutton avatar Anusha Ranganathan avatar James Cloos avatar  avatar  avatar  avatar Hrafn Malmquist avatar Ramakrishna Sakhamuru avatar Kushagra Varade avatar  avatar

esprit's Issues

es_version should be a property of Connection

Some functions require anes_version because the syntax has changed between versions, e.g. the put_mapping function in raw:

put_mapping(connection, type=None, mapping=None, make_index=True, es_version="0.90.13"):

This is acceptable until you want to write a task which requires more than one connection simultaneously. It's conceivable that you might want to connect to more than one version of ES at a time - perhaps reindexing from a 0.9 connection to a 5.2 connection. Here, it would be nicer if the es_version were a property of the Connection object, because it will always be fixed for a given index.

Ideally it would be taken out of all function args and only read from the connection, but that's a breaking change.

does this need to move under CottageLabs?

There's a repo using it already (uniboard) under the CottageLabs organisation and I'd generally use it with new projects. Also I think DOAJ will be using this? (correct me if wrong ofc..)

Put this on PyPI?

Basically right now I have to do requirements.txt magic on projects that rely on this lib, instead of just referencing "esprit" in the install dependencies.

Example: https://github.com/CottageLabs/uniboard/blob/master/requirements.txt

I haven't done this before, I think you have @richard-jones ? Of course after any updates the version will have to be bumped and the package pushed up to pypi.

We can also keep using the requirements.txt method of course, just that it means changing the way any project that uses this library is installed. pip install -r requirements.txt instead of pip install -e . .

Iterate() method alters queries

When you declare a query and attempt to run more than one task on it, it can be modified by esprit:

query = {'query': {'term': {'admin.application_status.exact': 'rejected'}}}

Then run a task which called iterate(...), such as tasks.dump(...) then it is changed for the next task that uses it:

query is now {'sort': [{'id': {'order': 'asc'}}], 'query': {'term': {'admin.application_status.exact': 'rejected'}}, 'from': 8000, 'size': 1000}

This can be fixed by either passing query.copy() into the task in the first place, or each task could be careful to only modify a copy of the query within their methods so the original is unaffected. I'm happy to make the code changes if you choose the latter option.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.