From 072f5c04e02a5412a0238286b0d3644d3a2a9267 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Wed, 9 Jul 2014 16:07:53 +0100 Subject: [PATCH] Docs fixes --- docs/wagtailsearch/backends.rst | 2 ++ docs/wagtailsearch/for_python_developers.rst | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/wagtailsearch/backends.rst b/docs/wagtailsearch/backends.rst index f6bb2f296..bd4974b11 100644 --- a/docs/wagtailsearch/backends.rst +++ b/docs/wagtailsearch/backends.rst @@ -11,6 +11,8 @@ Wagtail can degrade to a database-backed text search, but we strongly recommend .. _Elasticsearch: http://www.elasticsearch.org/ +.. _wagtailsearch_backends_database: + Database Backend =============== diff --git a/docs/wagtailsearch/for_python_developers.rst b/docs/wagtailsearch/for_python_developers.rst index 44332a819..01098fdde 100644 --- a/docs/wagtailsearch/for_python_developers.rst +++ b/docs/wagtailsearch/for_python_developers.rst @@ -87,7 +87,7 @@ Indexing callables and other attributes .. note:: - This is not supported in the `Database Backend`_ + This is not supported in the :ref:`wagtailsearch_backends_database` Search/filter fields do not need to be Django fields, they could be any method or attribute on your class. @@ -134,12 +134,12 @@ To do this, inherit from ``indexed.Indexed`` and add some ``search_fields`` to t published_date = models.DateTimeField() search_fields = [ - SearchField('title', partial_match=True, boost=10), - SearchField('get_genre_display'), + indexed.SearchField('title', partial_match=True, boost=10), + indexed.SearchField('get_genre_display'), - FilterField('genre'), - FilterField('author'), - FilterField('published_date'), + indexed.FilterField('genre'), + indexed.FilterField('author'), + indexed.FilterField('published_date'), ] # As this model doesn't have a search method in its QuerySet, we have to call search directly on the backend