From e2ddd520305d64f2541a59493042c8de6a253eb8 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Mon, 11 Oct 2021 11:04:24 +0100 Subject: [PATCH] Updates to docs for new database search backend A more detailed comparison of the features supported in different databases will come later. --- docs/reference/management_commands.rst | 2 +- docs/topics/search/backends.rst | 27 ++++++-------------------- docs/topics/search/indexing.rst | 5 ----- 3 files changed, 7 insertions(+), 27 deletions(-) diff --git a/docs/reference/management_commands.rst b/docs/reference/management_commands.rst index eaae2ab08e..911ad0ada6 100644 --- a/docs/reference/management_commands.rst +++ b/docs/reference/management_commands.rst @@ -71,7 +71,7 @@ update_index $ ./manage.py update_index [--backend ] -This command rebuilds the search index from scratch. It is not required when using the database search backend (``wagtail.search.backends.db``). +This command rebuilds the search index from scratch. It is recommended to run this command once a week and at the following times: diff --git a/docs/topics/search/backends.rst b/docs/topics/search/backends.rst index da2efcb0aa..c43077ba9f 100644 --- a/docs/topics/search/backends.rst +++ b/docs/topics/search/backends.rst @@ -13,7 +13,7 @@ You can configure which backend to use with the ``WAGTAILSEARCH_BACKENDS`` setti WAGTAILSEARCH_BACKENDS = { 'default': { - 'BACKEND': 'wagtail.search.backends.db', + 'BACKEND': 'wagtail.search.backends.database', } } @@ -61,29 +61,14 @@ Here's a list of backends that Wagtail supports out of the box. Database Backend (default) -------------------------- -``wagtail.search.backends.db`` +``wagtail.search.backends.database`` -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, severely hampering its usefulness when searching a large collection of pages. +.. versionchanged:: 2.15 -It also doesn't support: + The default database search backend was changed from ``wagtail.search.backends.db`` -- 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. - -.. _wagtailsearch_backends_postgresql: - -PostgreSQL Backend ------------------- - -``wagtail.contrib.postgres_search.backend`` - -If you use PostgreSQL for your database and your site has less than -a million pages, you probably want to use this backend. - -See :ref:`postgres_search` for more detail. +The database search backend searches content in the database using the full text search features of the database backend in use (such as PostgreSQL FTS, SQLite FTS5). +This backend is intended to be used for development and also should be good enough to use in production on sites that don't require any Elasticsearch specific features. .. _wagtailsearch_backends_elasticsearch: diff --git a/docs/topics/search/indexing.rst b/docs/topics/search/indexing.rst index fe9da58e7b..07a314cc1c 100644 --- a/docs/topics/search/indexing.rst +++ b/docs/topics/search/indexing.rst @@ -66,11 +66,6 @@ The search may not return any results while this command is running, so avoid ru Indexing extra fields ===================== -.. warning:: - - Indexing extra fields is only supported by the :ref:`wagtailsearch_backends_elasticsearch` and :ref:`wagtailsearch_backends_postgresql`. Indexing extra fields is not supported by the :ref:`wagtailsearch_backends_database`. If you're using the database backend, any other fields you define via ``search_fields`` will be ignored. - - Fields must be explicitly added to the ``search_fields`` property of your ``Page``-derived model, in order for you to be able to search/filter on them. This is done by overriding ``search_fields`` to append a list of extra ``SearchField``/``FilterField`` objects to it.