This is a search engine built using Go and Elasticsearch.
It functions by scraping quotes from Goodreads and indexing the data into elasticsearch. With elasticsearch's robust text analysis capabilities, the data can then be queried. Here, we simply query based on the content of a quote or the name of the author. This application has both CLI and web UI for search and indexing operations.
- github.com/gocolly/colly v1.2.0: For web scraping
- github.com/olivere/elastic/v7 v7.0.22: For interacting with elasticsearch
- github.com/spf13/cobra v1.1.1: For CLI
- github.com/sirupsen/logrus v1.2.0: For server logs
- Next.js v10 and Tailwind v2: For frontend web app
- Clone into repo
- Install elasticsearch and start service. Using homebrew simply run,
brew install elasticsearch
elasticsearch
- Using CLI, index data by, (for indexname and number of quotes to be indexed you can pass in flags)
go run main.go index
- Search with CLI,
go run main.go search Mark Twain
OR
- Search with UI, by first starting server,
go run main.go server
- Then start frontend,
cd web-ui
yarn
yarn start
