Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/donrestarone/rails-elasticsearch
a sample application that features elasticsearch with autocompletion/suggestion + highlights
https://github.com/donrestarone/rails-elasticsearch
Last synced: 25 days ago
JSON representation
a sample application that features elasticsearch with autocompletion/suggestion + highlights
- Host: GitHub
- URL: https://github.com/donrestarone/rails-elasticsearch
- Owner: donrestarone
- Created: 2020-06-09T01:11:10.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-03-08T19:17:28.000Z (almost 2 years ago)
- Last Synced: 2024-10-27T16:41:47.275Z (2 months ago)
- Language: Ruby
- Homepage:
- Size: 62.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# README
## To install elastic-search on ubuntu
grab the elastic public GPG key and put it into apt
```bash
curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
```
add the elastic source```bash
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
``````bash
sudo apt update
``````bash
sudo apt install elasticsearch
```to start elastic search
```bash
sudo systemctl start elasticsearch
```## Setup the rails app
```bash
rails db:create && rails db:migrate && rails db:seed && rails s
```## What you can expect
Check out the tests for queries. Here I am verifying the behavior of word stems, misspelling, highlighting and suggestions.
![Rspec tests](https://i.imgur.com/vpN8N8y.png)With postman we see the JSON structure that is returned by the API. In this example, I misspell Wonder Woman and get a suggestion with the correct spelling
![Postman tests](https://i.imgur.com/ZtDsrx9.png)In this example, we see the highlighting feature.
![Postman tests](https://i.imgur.com/fC9kI4L.png)