aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorPjotr Prins2018-04-16 09:00:52 +0000
committerPjotr Prins2018-04-16 09:00:52 +0000
commitdda4697505aea2cd950533dfb3a0dfb0e66ec018 (patch)
treee631415c8f49e4a85b85fe36a62082e866e173d6 /wqflask
parentfdd28defcaf3326f3c6b6507124708d83a1da119 (diff)
downloadgenenetwork2-dda4697505aea2cd950533dfb3a0dfb0e66ec018.tar.gz
Docs on elasticsearch use
Diffstat (limited to 'wqflask')
-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 7d2ee8c9..4d4a9844 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