Skip to content

Kandy-Peter/rails-search-engine

Repository files navigation

RAILS REALTIME SEARHC ENGINE

Description

The rails realtime search engine is a simple search engine that allows you to search for a specific term in a specific model from Atricles, post , etc. It uses the [pgSearch gem] to search for the term in the database and returns the results in a realtime and save all queries in segment for only the current user.

Lve Demo

Live Demo Link

Installation

Add this line to your application's Gemfile:

gem 'chartkick'
gem 'pg_search'

And then execute:

$ bundle install

Or install it yourself as:

  $ gem install pg_search
  etc...

Start command

$ rails db:create
$ rails db:migrate
$ rails db:seed
$ rails s

Prerequisites

$ rails > 7
$ ruby > 3.0.0
$ postgresql > 13.3

Usage

to laod the articles from newsapi.org you need a .env file with:

API_KEY=your_api_key

then run the command: rails db:seed

Author

👤 Kandy Peter Kamuntu