From 848f452430ea20422648741c8e0d24a4104c88c0 Mon Sep 17 00:00:00 2001 From: "Julian M. Kunkel" Date: Tue, 14 May 2019 21:08:30 +0100 Subject: [PATCH] A bit further --- docker/elasticsearch.json | 36 ++++++++++++++++++++++++++++++++++ docker/setup-elastic-search.sh | 12 ++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 docker/elasticsearch.json create mode 100644 docker/setup-elastic-search.sh diff --git a/docker/elasticsearch.json b/docker/elasticsearch.json new file mode 100644 index 0000000..91fd44e --- /dev/null +++ b/docker/elasticsearch.json @@ -0,0 +1,36 @@ +{ + "settings" : { + "number_of_shards" : 1 + }, + "mappings" : { + "document": { + "properties" : { + "cluster" : { + "properties": { + "id": {"type": "keyword"} + } + }, + "title" : { "type" : "text"}, + "title_cleaned" : { + "type" : "text", + "index": "no" + }, + "author" : { "type" : "text"}, + "url" : { "type" : "text", "index": "not_analyzed"}, + "notes" : { "type" : "text"}, + "tags" : { "type" : "text"}, + "group_name" : { "type" : "keyword", "index": "not_analyzed"}, + "group_description" : { "type" : "text", "index": + "not_analyzed"}, + "group_image" : { "type" : "keyword", "index": + "not_analyzed"}, + "discipline" : { "type" : "keyword"}, + "extras" : { "type" : "text"}, + "language" : { "type" : "keyword"}, + "created_at" : { "type" : "date", + "format": "yyyyMMdd" + } + } + } + } +} diff --git a/docker/setup-elastic-search.sh b/docker/setup-elastic-search.sh new file mode 100644 index 0000000..9eefc1b --- /dev/null +++ b/docker/setup-elastic-search.sh @@ -0,0 +1,12 @@ +#!/usr/bin/bash +# https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html + +docker pull docker.elastic.co/elasticsearch/elasticsearch:7.0.1 + +docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.0.1 +# curl http://elasticsearch:9200/_cat/health + +curl -XPUT -H 'Content-Type: application/json' -T elasticsearch.json 'http://localhost:9200/app' +# https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html + +curl -GET "http://localhost:9200/_cat/indices?v"