Haystack - Python custom search solution

Haystack is a Python solution for search engines that allows to switch between different backends without having to modify the initial code.

Search is an inseparable part of modern web development. Internet users tend to rely more on the search results than on random browsing. It saves time and is more target oriented. Building reliable and efficient search engine was highly demanding but required part of the web development. Now the process is simplified. There are several Python solutions for the cases, when Google or Yahoo search doesn’t fit customer’s needs, or client wants customized search for more than just the main content.

Haystack supplies modular search for a popular Python framework - Django. It is portable interface for any domain-specific third-party backends. Search code is written only once and it can be switched between several most common search engines the developer wants to run on.

Haystack is BSD licensed and supports such widely used backends as Solr, Elasticsearch, Whoosh and Xapian. The main difficulty is that the Python bindings for a certain engine may have been released under an incompatible license. Import of the new bindings may mean whole codebase conversion into another license as a result.

Haystack default views and forms provide solution for the most common cases, like:

  • Basic, query-only search.
  • Search by models.
  • Search with basic highlighted results.
  • Faceted search.
  • Search by models with basic highlighted results.

Haystack enables more advanced features, including:

  • Full SearchQuerySet support.
  • Automatic query building.
  • “More Like This” functionality.
  • Stored (non-indexed) fields.
  • Boosting scores specific documents better than they otherwise would be (Term Boost, Document Boost, Field Boost).
  • Faceting provides several facets for user to narrow down the search results.
  • Highlighting singles out search engine keywords in the text.
  • Spatial search (only in Solr and Elasticsearch) uses data that contains geographic location to improve the search results by restricting them to the physical area.

How to get started
Want to add customized search to your website? Contact Quintagroup and receive search engine solution for your project.

Connect with our experts Let's talk