Tanning Bed

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Tanning Bed - Presentation Transcript

    1. Tanning Bed by Rob Kaufman Notch8.com made possible by Assaydepot.com
    2. Tanning Bed?
    3.  
    4.  
    5.  
    6.  
    7.  
    8.  
    9. Why not acts_as_solr + it only works with Active Record
    10. Why not Sphinx
      • Less flexibility on keys
      • Facets must be configured ahead of time
      • Solr handles over the network use better
    11. Design Goals
      • Work with any Ruby class representing data (model)
      • Keep search away from the data store
      • Make it simple
      • Use the Solr Ruby bindings
    12. How is it used
      • Install the gem
      • Make sure you're class defines these methods
        • id - unique identifier for the record
        • Class.get - this method receives and object's id and loads it
        • solr_keys - an array of method names, the method results will be added to the index
      • Setup a save hook
    13. Example: CouchDB
      • # id is already implemented and so is get. CouchRest has a method called keys which we'll use class MyDocument < CouchRest::Model include TanningBed key_accessor :name key_accessor :address def solr_keys keys end end
    14. Example: ActiveRecord
      • # id is implemented in ActiveRecord already class MyModel < ActiveRecord::Base include TanningBed def get (value) find(value) end def solr_keys attribute_names end end
    15. Issue a Search Call
      • All models in result set (with facet)
        • TanningBed.solr_search(@query, :facets => {:fields => [:field_name_facet]})
      • One model only
        • MyModel.solr_search(@query)
    16. Whats the result?
      • result.data[&quot;docs&quot;] <= hash of ids
      • TanningBed.solr_load <= models
      • Facet Counts
        • @search.data[&quot;facet_counts&quot;][&quot;facet_fields&quot;][&quot;field_name_facet&quot;]
    17. Is setting up Solr hard
      • rake solr:start <- From TanningBed installed location
      • rake solr:start_testing
    18. Tanning Bed in Action
    19. Is It Complicated?
      • LOC 142
      • COMMENTS 29
      • BLANK 32
      • LINES 201
    20. Where
      • http://github.com/notch8/tanning_bed
      • [email_address]

    + Rob KaufmanRob Kaufman, 5 months ago

    custom

    195 views, 0 favs, 1 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 195
      • 188 on SlideShare
      • 7 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 2
    Most viewed embeds
    • 7 views on http://notch8.com

    more

    All embeds
    • 7 views on http://notch8.com

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories