Refactored code to allow for new database types to work with RailsSimpleSearch