Creating New Backends

The process should be fairly simple.

  1. Create new backend file. Name is important.
  2. Two classes inside.
    1. SearchBackend (inherit from haystack.backends.BaseSearchBackend)
    2. SearchQuery (inherit from haystack.backends.BaseSearchQuery)

SearchBackend

Responsible for the actual connection and low-level details of interacting with the backend.

  • Connects to search engine
  • Method for saving new docs to index
  • Method for removing docs from index
  • Method for performing the actual query

SearchQuery

Responsible for taking structured data about the query and converting it into a backend appropriate format.

  • Method for creating the backend specific query - build_query.