-
Notifications
You must be signed in to change notification settings - Fork 1
a simple wrapper around ultrasphinx to give a more straightforward search interaction
License
flogic/ultraspinx
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
= Ultraspinx <b>Version 0.0.2 (Aug 11, 2008)</b> Author:: Rick Bradley (mailto:rick@ogconsultin.gs) Ultraspinx provides a wrapper around the Ultrasphinx Rails search plugin. Ultraspinx provides a Model.search() class method for any ActiveRecord::Base models in the application. The Model.search method will simply call the generic Ultrasphinx::Search method, setting the model class to be searched to Model, and passing along any provided options to Ultrasphinx::Search. If you invoke Model.search() with a block, you can perform a custom fetch of objects from the database, for instance adding an :include. == Installation Unpack the ultraspinx directory into vendor/rails/ in your rails project. == Testing Install the rspec and mocha gems, then cd into the ultraspinx directory. Type 'spec spec/' and you should see all specs run successfully. If you have autotest from the ZenTest gem installed you can run autotest in that directory. == Using Ultraspinx Drug.search(:query => 'tylenol').size => 20 ActiveRecord::Base.search(:query => 'dude', :class_names => [ 'Entry', 'AccountProvider']) => [ ... ] Drug.search(:query => 'tylenol') do |query| result_ids = query.results.collect{ |result| result.last } Drug.find(result_ids, :include => 'group_information') end == LICENSE Copyright (c) 2008 Flawed Logic, OG Consulting, Rick Bradley 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 NONINFRINGEMENT. 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.
About
a simple wrapper around ultrasphinx to give a more straightforward search interaction
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published