CloudSpokes Search Demo
Ruby JavaScript Perl
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
public
views
Gemfile
Gemfile.lock
Procfile
README.markdown
README.md
challenges.json
test.rb
web.rb

README.markdown

demo

http://cs-search.herokuapp.com/

source

https://bitbucket.org/soe/cs-search/get/master.zip

overview

  • built on Sinatra, deployed on Heroku with RedisToGo
  • http://cs-search.herokuapp.com/post to post challenges JSON
  • search support keyword index with metaphones/typos/mis-spellings

endpoints

  • '/' - main page with search form
  • '/search' - accepts post request, return json of challenges
  • '/post' - an easy form to upload challenges.json

structure

  • web.rb ... main file with controllers/routers, and functions
  • views/ ... erb views

redis structure

Keyword based search index

(Sets) keyword:, (Sets) keyword:

To store minimal required data for each challenge

(Keys) title:, (Keys) end_date:, (Keys) open:, (Sets) categories:, (Sets) category:<category_name>

To keep track of open and closed challenges

(Sets) open_challenges, (Sets) closed_challenges

To keep track of categories

(Sets) category_names

deployment

  1. clone this git repository

git clone https://bitbucket.org/soe/cs-search.git

  1. then create a heroku project

heroku create

  1. then push to heroku

git push heroku master

  1. then update ENV["RTOGO_URL"]

functions

Following functions worth special mention... For all functions,please refer to inline comments...

search(open = true, sort = "alpha", order= "asc", keywords = nil, categories = nil, inclusive = true)

do various searches with sorting

metaphones_for_keyword(keyword, buggy = true)

generate list of metaphones: typos, mis-spellings

screencast

https://vimeo.com/45731039