The Divio Cloud offers you search (ElasticSearch) as a service, which allows you to integrate advanced search features directly into your project without having to manage complex search clusters.

See below for the different options available.

How to configure Haystack

To enable the service for your project, please contact us, and we will provision it on your Cloud project

The DEFAULT_HAYSTACK_URL environment variable

This is required, and we will it up for you when the service is provisioned. It takes the form:

DEFAULT_HAYSTACK_URL=es+http://hostname:9200/my-index-name

There is also native support for AWS ElasticSearch style connections:

DEFAULT_HAYSTACK_URL=es+https+aws://AWS_ACCESS_KEY:AWS_SECRET_KEY@cluster-name.us-east-1.amazonaws.com/my-index-name

There is also support to define the index name with a wildcard * that can be used for things like easy multilingual index setup.

Scheduled indexing

Set up a cron job, for example:

python manage.py rebuild_index --noinput

Debugging

Set the ALDRYN_HAYSTACK_DEBUG environment variable to True to get detailed logs from Haystack.

Local environment set-up

For local development add an ElasticSearch service to docker-compose.yml:

es:
    image: elasticsearch:2.3

and add a link to it from the web service:

web:
    links:
      - "es:es"

Then add the environment variable to configure the connection (on the default aldryn setup: add to .env-local):

DEFAULT_HAYSTACK_URL=es+http://es:9200/local-*

Test the connection:

docker-compose run --rm web python manage.py shell
>>> from haystack.query import SearchQuerySet
>>> list(SearchQuerySet())
[]

There won't be any results yet, since nothing has so far been indexed. However you will get an error if the connection does not work.

For further information

To learn more about how to setup your project, please see the Aldryn Haystack GitHub Repository.

Haystack options on Divio Cloud

Sandbox

  • Ideal to test your project functionality on the test environment
  • 10'000 documents and 10'000 daily request
  • 1 Index and 1 concurrent search
  • Manual backup by user

Haystack 1

  • Available for Divio Cloud Business subscriptions
  • 1 GB SSD Capacity
  • 100'000 documents and unlimited daily requests
  • 1 index and 1 concurrent search
  • Manual backup by user

Haystack 10

  • Included with Divio Cloud Business Protection+ subscriptions
  • 10 GB SSD Capacity
  • 1'000'000 documents and unlimited daily requests
  • 1 index and 5 concurrent searches
  • Manual backup by user

Haystack 30

  • Upgrade your search power for advanced search implementations
  • 30 GB SSD Capacity
  • 15'000'000 documents and unlimited daily requests
  • 3 indexes and 15 concurrent searches
  • Automatic daily backups for 14 days

Custom

  • Need more power and indexes? We're happy to setup the configuration you need.
Did this answer your question?