File: README.rst

package info (click to toggle)
python-elasticsearch 1.4.0-2~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 636 kB
  • sloc: python: 3,209; makefile: 155
file content (25 lines) | stat: -rw-r--r-- 875 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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.