torchbox/wagtail — pull request #29 by kaedroho (2014-02-11 11:42:19+00:00)
Title: Multiple backend support in wagtailsearch

This pull request adds multiple backend support into wagtail search, fixing #14. It also adds a new database backend which doesn't require ElasticSearch to run (uses __icontains filters).

The configuration for wagtail search has now changed. By default, it now uses the database backend. If you would like to still use the ElasticSearch backend, you would need to change your configuration:

WAGTAILSEARCH_BACKENDS = {
'default': {
'BACKEND': 'wagtail.wagtailsearch.backends.elasticsearch.ElasticSearch',
'URLS': # Equivalent to the old WAGTAILSEARCH_ES_URLS setting
'INDEX': # Equivalent to the old WAGTAILSEARCH_ES_INDEX setting
}
}

You don't need to set URLS and INDEX as these still have the same default values their predecessors had.

Known issues: Currently, the database backend ignores the "object_indexed" attribute that prevents the Root page from being indexed. As the database backend doesn't have an indexing stage, this is never checked and its quite difficult to check while searching. Also, the database backend doesn't currently support ngrams (for predictive search) or boosting.