• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Faceted navigation using django haystack and solr
 

Faceted navigation using django haystack and solr

on

  • 7,030 views

Started publishing some code here: https://github.com/Nagyman/django-faceted-search Lots to do to make it more generally useful as it was extracted from a larger project.

Started publishing some code here: https://github.com/Nagyman/django-faceted-search Lots to do to make it more generally useful as it was extracted from a larger project.

Statistics

Views

Total Views
7,030
Views on SlideShare
7,028
Embed Views
2

Actions

Likes
9
Downloads
61
Comments
3

2 Embeds 2

https://si0.twimg.com 1
https://twitter.com 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

13 of 3 previous next Post a comment

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • Ditto the two comments below. I am making progress with django-haystack-solr, but have a long way to go. I believe your presentation will be a big help, but I have a long way to go to get all the pieces working together. More code would certainly accelerate the process. Thanks for sharing what you already have. wjburris@gmail.com
    Are you sure you want to
    Your message goes here
    Processing…
  • Yes, please, I am working with facets and haystack, and I would really benefit from your code, as an example. Is this part of an open source project?
    Are you sure you want to
    Your message goes here
    Processing…
  • Great deck, Craig! Is your facet code published anywhere? I think a lot of people would find your classes and template tags useful, either directly or as an example to work from.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • * (size, price, brand, type, categories).\n* improving findability\n* like products (e.g computers) not unlike products (books & cars)\n\n
  • AirBnb, Zappos, ToysRUs\n
  • Browse vs Search\nLinks vs Forms\nOften little or “No Results”\nUnpredictable combinations\n
  • SQL - Don’t torture yourself; not made for search\n
  • * Lucene: boosting, boolean, wildcards, ranges, grouping, etc. But Haystack takes care of this, unless you need more advanced searching\n* avoid hitting your DB\n
  • starting schema provided with Haystack - django_ct, django_id important for differentiating content types\nexpected text field for full-text search\n
  • * filter, exclude, order_by, highlight\n
  • * Similar to django model definition. If fields mirror model exactly, no extra work required. Otherwise use\n
  • * SearchIndex, a la django model definitions. Denormalize your data here.\n* text field template\n* prepare fields for indexing\n\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Faceted navigation using django haystack and solr Faceted navigation using django haystack and solr Presentation Transcript

  • Faceted Navigation with django-haystack and solrDjangoTO 2012-02-09Craig Nagy @nagyman
  • What is Faceted Navigation/Browsing?• Visible options for narrowing a set of items based on metadata; interactive query building• Important for e-commerce sites with a significant number of products; shared classifications/metadata• Browse vs Search, Links vs. Forms
  • Engines with Faceted Search• Commercial: Endeca, FAST Search Server (Microsoft, SharePoint)• Open Source: solr (backed by Apache Lucene), Whoosh, Sphinx (“multi- queries”)• SQL - COUNT, GROUP BY, JOINs, oh my
  • Solr• Full text, faceted, distributed, amazing performance (Java)• Lucene syntax - title:”The Right Way” AND text:go, text:swim?ing, test~, craig nagy^4• JSON/XML API - transparent with Haystack• Run in a servlet container (e.g. Tomcat); Haystack provides easy local testing (Jetty) - manage.py solr --start• Data is denormalized; documents based on a schema
  • Solr Schema • All fields to index in schema.xml. Haystack has tools to help generate this file (manage.py build_solr_schema)• _exact fields for facets, multiValued=”true” for lists of data, data types
  • Haystack• Provides QuerySet-like API to a number of search backends haystack.query.SearchQuerySet • sqs = SearchQuerySet().filter(content=foo, pub_date__lte=datetime.date(2012, 1, 1))• Mirror your models, and any value you want to index• Automatic content_type handling• Performance Tip: Don’t access unindexed data
  • Haystack - Indexing• subclass haystack.indexes.SearchIndex.• prepare_<fieldname> or prepare callbacks• manage.py update_index or real-time
  • Full text indexingPrepare FieldsRegister
  • Not Included• Not included in Haystack • Views, templates, utilities, generating URLs, handling special data types• Custom Helpers: Searcher, FacetList, Facet, FacetItem, templatetags• Extras: Facet Landing Pages (e.g. Etsy, Zappos, G Adventures)
  • Facet Parsing• Haystack returns dictionaries of facet data; we parse into custom objects
  • Template Tagstemplatetags for arranging the faceted navigation
  • UI Pattern - Integrated Faceted Breadcrumbs (IFB)• http://boxesandarrows.com/view/faceted-finding-with (by Greg Nudelman)
  • Integrated Faceted Breadcrumbs
  • Refs• http://www.flickr.com/photos/morville/collections/72157603789246885/• http://haystacksearch.org/• https://github.com/toastdriven/django-haystack• http://boxesandarrows.com/view/faceted-finding-with• http://lucene.apache.org/solr/• http://django-haystack.readthedocs.org/en/latest/tutorial.html• http://www.gadventures.com/trips/
  • Fin.