sc0ttwad3 / koa-elasticsearch-guttenberg-tutorial

Vue portal to node/koa service for full-text searching elasticsearch/kibana indexed Gutenberg Project literary works.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

koa-elasticsearch-guttenberg-tutorial 👋

Version Documentation Maintenance License: MIT

Vue portal to node/koa service for full-text searching elasticsearch/kibana indexed Gutenberg Project literary works.

Made with lots of ☕️ by sc0ttwad3

Install

npm install

elasticsearch/kibana

Use docker-compose.yaml to spin up elasticsearch/kibanan with persistent storage and node app.

docker-compose up # down to tear down

First create an index for the books and verify it is listed as one of the indices:

λ curl -XPUT http://localhost:9200/books
{"acknowledged":true,"shards_acknowledged":true,"index":"books"}

λ curl -XGET http://localhost:9200/_cat/indices?
green open books  plTl1SD0QUCRTvWOFLOLsw 1 1 0 0   460b   230b

The field mappings for book entries in book-mappings.json:

{
  "properties": {
    "author": {
      "type": "text",
      "analyzer": "standard"
    },
    "text": {
      "type": "text",
      "analyzer": "english"
    },
    "title": {
      "type": "text",
      "analyzer": "standard",
      "boost": 2
    }
  }
}

To create the elasticsearch index mappings:

$ curl -d "@book-mappings.json" -H 'Content-Type: application/json' -X PUT "localhost:9200/books/_mappings"

(or use kibana devtools to PUT /books/_mappings and paste contents of book-mappings.json

Usage

npm run start

Run tests

npm run test

Author

👤 Scott Wade <sc0ttwad3@gmail.com> (http://sc0ttwad3.com)

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2020 Scott Wade sc0ttwad3@gmail.com (http://sc0ttwad3.com).
This project is MIT licensed.


This README was generated with ❤️ by readme-md-generator

About

Vue portal to node/koa service for full-text searching elasticsearch/kibana indexed Gutenberg Project literary works.


Languages

Language:JavaScript 75.7%Language:HTML 13.8%Language:CSS 9.1%Language:Dockerfile 1.4%