aboutsummaryrefslogtreecommitdiff
path: root/wqflask/utility/elasticsearch_tools.py
diff options
context:
space:
mode:
authorMuriithi Frederick Muriuki2018-04-16 17:28:22 +0300
committerMuriithi Frederick Muriuki2018-04-16 17:28:22 +0300
commitf8df8836e33ad226aaa7d2f8874d7a1a08a670dc (patch)
tree36d455819dd74615151d64e0360b90382d0c89d6 /wqflask/utility/elasticsearch_tools.py
parentbc1672f8617c56684ae3aeda7018362e818c46d6 (diff)
parentdda4697505aea2cd950533dfb3a0dfb0e66ec018 (diff)
downloadgenenetwork2-f8df8836e33ad226aaa7d2f8874d7a1a08a670dc.tar.gz
Merge remote-tracking branch 'pjotrp/testing' into testing
Diffstat (limited to 'wqflask/utility/elasticsearch_tools.py')
-rw-r--r--wqflask/utility/elasticsearch_tools.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/wqflask/utility/elasticsearch_tools.py b/wqflask/utility/elasticsearch_tools.py
index 0dc59d43..76dcaebf 100644
--- a/wqflask/utility/elasticsearch_tools.py
+++ b/wqflask/utility/elasticsearch_tools.py
@@ -1,3 +1,44 @@
+# Elasticsearch support
+#
+# Some helpful commands to view the database:
+#
+# You can test the server being up with
+#
+# curl -H 'Content-Type: application/json' http://localhost:9200
+#
+# List all indices
+#
+# curl -H 'Content-Type: application/json' 'localhost:9200/_cat/indices?v'
+#
+# To see the users index 'table'
+#
+# curl http://localhost:9200/users
+#
+# To list all user ids
+#
+# curl -H 'Content-Type: application/json' http://localhost:9200/users/local/_search?pretty=true -d '
+# {
+# "query" : {
+# "match_all" : {}
+# },
+# "stored_fields": []
+# }'
+#
+# To view a record
+#
+# curl -H 'Content-Type: application/json' http://localhost:9200/users/local/_search?pretty=true -d '
+# {
+# "query" : {
+# "match" : { "email_address": "pjotr2017@thebird.nl"}
+# }
+# }'
+#
+#
+# To delete the users index and data (dangerous!)
+#
+# curl -XDELETE -H 'Content-Type: application/json' 'localhost:9200/users'
+
+
from elasticsearch import Elasticsearch, TransportError
import logging