Rfizzy

A ruby library utilizing Redis for;

### Key Features # * Very unobtrusiv # * Very easy to add to a project # * Very easy to remove from a project # * Small memory foot print, # * very tiny code base compared to other libraries and in contrast to what it adds to a project # * Fast # * No learning curve # * Works with any ORMs out of the box… # * … Since it's not attached to any of ORMs # ***

Works in all Ruby projects, regardless of ORM as long as an attribute has a way to identify it (e.g ID column). Very simple built, source code is < 100 loc and has full test coverage. Easy to tap into any project without high learning curve or code breakage. Easy to remove as well. VERY unobtrusive.

Introduction

class Tweet < ActiveRecord::Base

after_create :create_search_index
before_destroy :destroy_search_index

private
def create_search_index
  FullTextSearch.create_index :attribute_namespace => :tweet_text_content,
                              :document_id => id,
                              :words => text_content

end

def destroy_search_index
  FullTextSearch.destroy_index  :attribute_namespace => :tweet_text_content,
                                :document_id => id,
                                :words => text_content

end

end

set_of_ids = FullTextSearch.search_index :attribute_namespace => :article_text,

:search => text_content

Article.where(:id => set_of_ids)

Contributing to Rfizzy

Copyright © 2011 Seifvan Heifdari af Awesomeness Von Cheeseburger

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. By not reading this fine print your soul is now the exclusive property of Seivan Heidari Productions and its Subsidiaries. Unauthorized use of Seivans code, images, materials, souls, odors and oxygen is strongly discouraged. We know where you sleep. Also, I might have banged your mums pool boy. Sorry about that.