Facet Searching using Ultrasphinx

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

    1 Favorite

    Facet Searching using Ultrasphinx - Presentation Transcript

      • Faceted browsing
      • using
      • UltraSphinx
    1. About me
      • A passionate rails developer
      • Author of
        • Rails plugin State Select
        • Bash and ruby utility scripts
      • Work with Vinsol
      • Blog: http://webonrails.com
    2. Traditional Search Tools
      • Designed to retrieve information
      • Situations in which the user knows exactly what he wants
      • Perform quite badly in most real situations
        • Buying a digital camera
        • Finding a Job
        • Selecting a photo
        • Finding a restaurant
    3. Facets?
      • Attributes of an Object in various categories
      • Examples:
        • Music catalog: songs have attributes such as album, artist, title, length, date...
        • Recipes: cuisine, main ingredients, cooking style...
        • Content Site: articles have authors, dates, category, tags...
        • Image collection: artist, date, style, type of image, major colors, theme...
    4. Faceted Search
      • Drilling down search results using dynamic taxonomies called Facets
    5. Faceted Search
      • Includes exposing the facets in dynamic taxonomies
      • Allows user
        • To see exact options they have available to drill down the result
        • To switch easily between searching and browsing, using their own terminology for search
    6. Features Faceted Search
      • Displaying various aspects of the current results set in multiple categorizations
      • Showing only populated categories, no dead-ends (links leading to empty lists)
        • To see exactly the options they have available at that time
        • Displaying a count of the contents of each category
    7. When we need Faceted Search?
      • User need to filter content using multiple taxonomy terms
      • User want to combine text searches, taxonomy term filtering, and other search criteria
      • User don't know precisely what they can find on your site, or what to search for
      • Users often get empty result sets when searching your site
      • Site has too much content for it to be displayed through fixed navigational structures
      • "advanced" search forms are not fun to use
    8. Quick look at Ultrasphinx features
      • Searching and ranking across multiple models
      • Delta index support
      • Excerpt highlighting
      • Google-style query parser
      • Spellcheck
      • Faceting on text, date, and numeric fields
      • Field weighting, merging, and aliasing
      • Belongs_to and has_many includes
      • Drop-in compatibility with will_paginate
    9. Indexing Data
      • Article Model
      • is_indexed :fields => [
                  • 'created_at',
                  • 'title',
                  • {:field => 'body', :as => 'description'},
                  • {:field => 'category', :facet => true, :as => 'category_name' }
      • ],
      • :conditions => "status = 'published' ",
      • :include => [{:association_name => 'Author', :field => 'name', :as => 'author_name'}]
    10. Preparing index withUltrasphinx
      • rake ultrasphinx:configure
      • rake ultrasphinx:index
      • rake ultrasphinx:daemon:start
    11. Running Queries
      • @search = Ultrasphinx::Search.new(:query => @query, :class_names => 'Article', :per_page => 20)
      • @search.run
      • @search.results
    12. Lets do it practically
    13. Use Case
      • We have a Product model and we want to implement search on its various fields. Also we want to use its brand, category and celebration* as facets.
      * Occassion when a product can be used
    14. Product Model
      • is_indexed :fields => [ :description, :name,
      • {:field => :celebration, :facet => true}
      • ],
      • :include => [
      • { :association_name => 'brand', :field => 'name', :facet=>true, :as => 'brand',
      • :association_sql => "left outer join brands brand on products.brand_id =
      • brand.id"
      • },
      • { :class_name => "Category", :field => 'title', :facet=>true, :as => 'category',
        • :association_sql => "left outer join categories on category.id =
        • products.category_id"}
      • ]
    15. Prepare index and start search daemon
      • rake ultrasphinx:configure
      • rake ultrasphinx:index
      • rake ultrasphinx:daemon:start
      • * remember to restart app server
    16. Search Controller
      • @query = params[:query] || “”'
      • @filters = params[:filters] || '””
      • @page = params[:page] || 1
      • @search = Ultrasphinx::Search.new(:query => @query+" "+@filters, :facets => ["category", "brand", "celebration"], :page => @page, :class_names => 'Product')
      • @search.run
      • @products = @search.results
    17. View
    18. Output
    19. References
      • UltraSphinx
        • http://blog.evanweaver.com/files/doc/fauna/ultrasphinx
      • Sphinx
        • http://sphinxsearch.com/
      • Thanks a lot
      • :-)

    + Akhil BansalAkhil Bansal, 7 months ago

    custom

    1645 views, 1 favs, 6 embeds more stats

    More Info

    © All Rights Reserved

    Go to text version
    • Total Views 1645
      • 1396 on SlideShare
      • 249 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 0
    Most viewed embeds
    • 228 views on http://webonrails.com
    • 16 views on http://vinsol.com
    • 2 views on http://static.slideshare.net
    • 1 views on http://feeds.feedburner.com
    • 1 views on http://203.208.37.104

    more

    All embeds
    • 228 views on http://webonrails.com
    • 16 views on http://vinsol.com
    • 2 views on http://static.slideshare.net
    • 1 views on http://feeds.feedburner.com
    • 1 views on http://203.208.37.104
    • 1 views on http://blog.rubyonrails.co.in

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as innappropriate

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

    Cancel

    Categories