https://github.com/rogerwelin/es-app-tutorial
https://github.com/rogerwelin/es-app-tutorial
dataset elasticsearch golang search-interface
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rogerwelin/es-app-tutorial
- Owner: rogerwelin
- Created: 2017-09-20T18:12:59.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-11-21T16:52:40.000Z (over 6 years ago)
- Last Synced: 2025-07-20T20:50:16.130Z (11 months ago)
- Topics: dataset, elasticsearch, golang, search-interface
- Language: Go
- Size: 414 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Pull/run image
```shell
$ docker run -d -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:6.2.3
```
## Create index
```shell
$ curl -XPUT 'localhost:9200/cartoon?pretty' -H 'Content-Type: application/json' -d' { "settings" : { "index" : { "number_of_shards" : 3, "number_of_replicas" : 1 } } } '
```
## Import data
```shell
$ curl -XPOST -H "Content-Type: application/json" -XPOST --data-binary @dataset/anime.json http://localhost:9200/cartoon/_bulk?pretty=true
```
## View index status after import
```shell
$ curl -XGET localhost:9200/_cat/indices?v
```
## Make a simple search
```shell
$ curl -XGET 'localhost:9200/cartoon/_search?q=name:berserk&pretty'
```
## Start the Go backend
```shell
$ cd backend && go build && ./main
```
## Open the frontend and start typing anime titles
**On Mac**
```shell
$ open index.html
```
**On Linux**
```shell
$ google-chrome index.htnl
```