diff --git a/CHANGELOG.txt b/CHANGELOG.txt index dcf98b7ad8..1789ef612e 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -22,6 +22,7 @@ Changelog * Updated URLs within the admin backend to use namespaces * The `update_index` task now indexes objects in batches of 1000, to indicate progress and avoid excessive memory use * Added database indexes on PageRevision and Image to improve performance on large sites + * Search in page chooser now uses Wagtail's search framework, to order results by relevance * Fix: Text areas in the non-default tab of the page editor now resize to the correct height * Fix: Tabs in "insert link" modal in the rich text editor no longer disappear (Tim Heap) * Fix: H2 elements in rich text fields were accidentally given a click() binding when put insite a collapsible multi field panel diff --git a/docs/releases/1.1.rst b/docs/releases/1.1.rst index 2070849b92..e94f30862a 100644 --- a/docs/releases/1.1.rst +++ b/docs/releases/1.1.rst @@ -54,6 +54,7 @@ Minor features * Updated URLs within the admin backend to use namespaces * The ``update_index`` task now indexes objects in batches of 1000, to indicate progress and avoid excessive memory use * Added database indexes on PageRevision and Image to improve performance on large sites + * Search in page chooser now uses Wagtail's search framework, to order results by relevance Bug fixes ~~~~~~~~~ diff --git a/wagtail/wagtailadmin/views/chooser.py b/wagtail/wagtailadmin/views/chooser.py index 686e89d156..4b220fcdd3 100644 --- a/wagtail/wagtailadmin/views/chooser.py +++ b/wagtail/wagtailadmin/views/chooser.py @@ -118,7 +118,7 @@ def search(request, parent_page_id=None): if search_form.is_valid() and search_form.cleaned_data['q']: pages = desired_class.objects.exclude( depth=1 # never include root - ).filter(title__icontains=search_form.cleaned_data['q'])[:10] + ).search(search_form.cleaned_data['q'], fields=['title'])[:10] else: pages = desired_class.objects.none()