Commit 71b7be33 authored by Francesco Poldi's avatar Francesco Poldi

Added elasticsearch docs

parent dc70c89b
......@@ -40,8 +40,9 @@ Some of the benefits of using Tweep vs Twitter API:
3. Go to `http://localhost:5601`, `Dev Tools`, copy&paste from `index.json` and select the **green arrow**; (do this once)
4. Index some data: `python3.6 tweep.py --elasticsearch localhost:9200 -u whatsoever`;
5. Back to Kibana's interface, `Management`, `Index Pattern`, `Create Index Pattern`, type `tweep`, choose `datestamp` as Time filter; (do this once)
6. Go back to `Management`, `Saved Objects`, Import `dashboard.json` and than `visualization.json`; (do this once)
7. Have fun.
6. Have fun.
Unfortunately, you cannot import visualizations and/or dashboards if you do not have the same index id, so under `elasticsearch` directory I wrote a how-to for a initial setup.
If you have problems don't hesitate to write to the mainteiner [@pielco11](https://github.com/pielco11) or open an issue.
Feel free to edit the dashboard and don't hesitate to share it if you want.
......
# Elasticsearch How To
### Initial setup
From now on I'm assuming that you:
- indexed some data;
- created the index.
From the terminal open `elasticsearch` and when it's up and running open `kibana`.
Go to `http://localhost:5601` (default setting), go to `Discover` tab, choose `tweep` and you should see something like this:
![first view]('some1.png')
(if you are having some troubles with elasticsearch or kibana setup I suggest you to look into the corresponding documentation).
### Visualizations setup
So now we have some data to play with but we need to visualize it as we want some meaning.
Here is a histogram based on daily activity:
![daily]('daily.png')
How to:
- `Visulize` tab and than the blue `+` symbol;
- `Vertical bar`;
- select `tweep`;
- `X-Axis`, Aggregation: Terms, Field: hour, Order By: Term, Order: Ascending, Size: 24;
- click on `Add sub-buckets`, Split Series, Sub Aggregation: Terms, Field: username, Order By: Count, Order: Discending (or Ascending, depends on your needs), Size: 5 (for Top 5 or "worsts" 5);
- click on the blue arrow.
You can do the same for a weekly activity, just replace the settings for the X-Axis: `hour` and `Size: 24` with `day` and `Size: 7`.
Pie Charts for top users: you can base this on `likes`, `retweets` and `replies`.
Following the previous steps:
- create a Pie chart;
- Split Slices, Aggregation: Terms, Field: username;
- etc...
**Important**: write `_exists_:likes` or `_exists_:retweets` or `_exists_:replies` to filter out specific rank base.
You should see something like this:
![likes](likes.png)
### Dashboard setup
Pretty easy:
- select `Dashboard` tab;
- create new one;
- add previously created visualizations.
Now you have a basic setup. More is about to come.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment