Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for elasticsearch 1.0 or newer. #364

Merged
merged 1 commit into from
Jun 29, 2014

Conversation

miku
Copy link
Contributor

@miku miku commented Jun 27, 2014

Provides an ElasticsearchTarget and a CopyToIndex template task.

Modeled after luigi.contrib.rdbms.CopyToTable.

A minimal example (assuming elasticsearch is running on localhost:9200):

class ExampleIndex(CopyToIndex):
    index = 'example'

    def docs(self):
        return [{'_id': 1, 'title': 'An example document.'}]

if __name__ == '__main__':
    task = ExampleIndex()
    luigi.build([task], local_scheduler=True)

Tests can be run against a local elasticsearch index.

Provides an `ElasticsearchTarget` and a `CopyToIndex` template task.

Modeled after `luigi.contrib.rdbms.CopyToTable`.

A minimal example (assuming elasticsearch is running on localhost:9200):

    class ExampleIndex(CopyToIndex):
        index = 'example'

        def docs(self):
            return [{'_id': 1, 'title': 'An example document.'}]

    if __name__ == '__main__':
        task = ExampleIndex()
        luigi.build([task], local_scheduler=True)

Tests can be run against a local elasticsearch index.
@erikbern
Copy link
Contributor

Nice! LGTM

erikbern pushed a commit that referenced this pull request Jun 29, 2014
Added support for elasticsearch 1.0 or newer.
@erikbern erikbern merged commit 5d25c49 into spotify:master Jun 29, 2014
@miku
Copy link
Contributor Author

miku commented Jun 29, 2014

Thanks!

@erikbern
Copy link
Contributor

I haven't tested it – but I'm generally happy to merge anything to luigi.contrib that doesn't touch any of the core parts of Luigi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants