views:

591

answers:

1

Note: This question originally applied to Xapian, but due to cross-platform issues and poor understanding of Xapian I (our team) chose Solr instead.

I'm looking for snippets, tricks, tips, links, and anything to watch out for (gotchas). My technology stack includes:

  • MySQL 5.1 (Not really pertinent)
  • Red Hat and Windows configurations with final deployment to Linux
  • Development primarily done on windows machines on my team
  • No PHP or Java support in our configurations, ergo no Solr or Django-Sphinx Went with Java after all!

Thank you all for the help and insight!

+3  A: 

A few notes and resources. My advice is mostly related to Haystack in general since I don't have experience with Xapian as a backend.

  1. Installing Xapian (from the Haystack docs) - note that Haystack doesn't support Xapian on its own: http://haystacksearch.org/docs/installing%5Fsearch%5Fengines.html#xapian
  2. It may be helpful to use Whoosh during development or for testing certain things, but keep in mind that it doesn't support all the features Xapian does. Haystack does a good job of failing gracefully (a warning in your console) if you try to use Whoosh with a feature it doesn't support, so switching between them is painless: http://haystacksearch.org/docs/installing%5Fsearch%5Fengines.html#whoosh
  3. A snippet from my own code of switching between Whoosh and Solr easily:

    # Haystack search settings
    HAYSTACK_SITECONF = 'project.search_sites'
    HAYSTACK_INCLUDE_SPELLING = True
    # Haystack backend settings
    HAYSTACK_SEARCH_ENGINE = 'solr' # Switch this to 'whoosh' to use that backend instead
    if DEBUG:
        HAYSTACK_SOLR_URL = 'solr.development.url'
    else:
        HAYSTACK_SOLR_URL = 'solr.production.url'
    HAYSTACK_WHOOSH_PATH = os.path.join(PROJECT_ROOT, 'search_index', 'whoosh')
    
  4. As far as I'm aware your choice of database doesn't make a difference as long as Django supports it since Haystack uses the ORM.
  5. If you run into any trouble, Haystack's developer (Daniel Lindsley) is incredibly helpful and quick to respond. You can get help from him and others in the django-haystack Google group or the #haystack IRC channel (that is, if you don't find an answer in the official docs).
John Debs
Great answer, and I really appreciate you taking the time to respond, but I'm trying to find out in particular what is needed to make Xapian work with Haystack and Django. For example: Given a completely fresh environment on my local machine, what dependencies do I need to install, how do I integrate those dependencies, and what are some specific examples of code used to work with those dependenices?--in this case Xapian. Again, excellent response. If I reach this solution on my own, I will be sure to add a comment here with the solution, and mark your answer as accepted. Thanks again!
mkelley33
Well, we've added Solr to our technology stack. Many thanks to you!
mkelley33