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

Index JSON files with Elasticsearch #3

Closed
waldoj opened this issue May 16, 2014 · 1 comment
Closed

Index JSON files with Elasticsearch #3

waldoj opened this issue May 16, 2014 · 1 comment

Comments

@waldoj
Copy link
Member

waldoj commented May 16, 2014

Once we have Crump atomizing all JSON data as per-record files, create a shell script to index these files with Elasticsearch.

This was referenced May 16, 2014
@waldoj
Copy link
Member Author

waldoj commented May 16, 2014

Alternately, it may well be better to index these from the main JSON files. Now that we're representing records as one record per line, we can just iterate through each line and post them to Elasticsearch. It's tempting to do this with a shell script, but the bulk API may be better suited for this. That bulk data is best generated via Python or PHP, rather than a shell script. (A shell script is capable of it, but let's be realistic.)

We'll want to put together a wrapper that will chunk the requests, since I'm dubious that the bulk API ought to have, say, 300MB of JSON submitted via HTTP.

I think it's entirely possible that this can be done through a simple modification of the JSON files to be indexed. Simply replace every ,\n with \n{Elasticsearch JSON data}\n. The file would still need to be chunked, but that's a pretty light lift.

Huh, on reflection, that could be done at the command line.

@waldoj waldoj closed this as completed Aug 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant