Files
opensearch-pyd/example
Jason Veatch 5f199882d8 multi_field type is removed from 5, move to new format
Instead of ignoring all 400s when creating the index, only ignore
index_already_exists_exception and raise other exceptions.
2016-12-01 10:51:04 -05:00
..
2013-12-09 03:17:32 +01:00

Example code for `elasticsearch-py`
===================================

This example code demonstrates the features and use patterns for the Python client.

To run this example make sure you have elasticsearch running on port 9200,
install additional dependencies (on top of `elasticsearch-py`)::

    pip install python-dateutil GitPython

And now you can load the index (the index will be called `git`)::

    python load.py

This will create an index with mappings and parse the git information of this
repository and load all the commits into it. You can run some sample queries by
running::

    python queries.py

Look at the `queries.py` file for querying example and `load.py` on examples on
loading data into elasticsearch. Both `load` and `queries` set up logging so in
`/tmp/es_trace.log` you will have a transcript of the commands being run in the
curl format.