From 640383ad29e67a65f8e807e24ce5c8c4bc6426c2 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Fri, 29 May 2015 10:48:25 +0100 Subject: [PATCH] Updates to search backends docs --- docs/topics/search/backends.rst | 28 +++++++++++++++++++++------- docs/topics/search/indexing.rst | 3 ++- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/docs/topics/search/backends.rst b/docs/topics/search/backends.rst index adf104484..24d19ab0c 100644 --- a/docs/topics/search/backends.rst +++ b/docs/topics/search/backends.rst @@ -5,24 +5,38 @@ Backends ======== +Wagtailsearch has support for multiple backends giving you the choice between using the database for search or an external service such as Elasticsearch. -Wagtail can degrade to a database-backed text search, but we strongly recommend `Elasticsearch`_. - -.. _Elasticsearch: http://www.elasticsearch.org/ +You can configure which backend to use with the ``WAGTAILSEARCH_BACKENDS`` setting. .. _wagtailsearch_backends_database: -Database Backend -================ +Database Backend (default) +========================== -The default DB search backend uses Django's ``__icontains`` filter. +``wagtail.wagtailsearch.backends.db.DBSearch`` + +The database backend is very basic and is intended only to be used in development and on small sites. It cannot order results by relevance making it not very useful when searching a large amount of pages. + +It also doesn't support: + + - Searching on fields in subclasses of ``Page`` (unless the class is being searched directly) + - :ref:`wagtailsearch_indexing_callable_fields` + - Converting accented characters to ASCII + +If any of these features are important to you, we recommend using Elasticsearch instead. Elasticsearch Backend ===================== -Prerequisites are the Elasticsearch service itself and, via pip, the `elasticsearch-py`_ package: +``wagtail.wagtailsearch.backends.elasticsearch.ElasticSearch`` + +Prerequisites are the `Elasticsearch`_ service itself and, via pip, the `elasticsearch-py`_ package: + +.. _Elasticsearch: https://www.elastic.co/products/elasticsearch + .. code-block:: guess diff --git a/docs/topics/search/indexing.rst b/docs/topics/search/indexing.rst index 1fca1ad38..e51ca9f61 100644 --- a/docs/topics/search/indexing.rst +++ b/docs/topics/search/indexing.rst @@ -1,7 +1,6 @@ .. _wagtailsearch_indexing: - ======== Indexing ======== @@ -112,6 +111,8 @@ Options These are added to the search index but are not used for full-text searches. Instead, they allow you to run filters on your search results. +.. _wagtailsearch_indexing_callable_fields: + Indexing callables and other attributes ---------------------------------------