From 8903d1e74134d8c504cf0575f714bd669d9313c4 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Fri, 11 Jul 2014 16:17:03 +0100 Subject: [PATCH 1/2] Elasticsearch: Cast __in lookup values to list This makes sure lazily-evaluated lists (like querysets) are evaluated so they can be converted to JSON --- wagtail/wagtailsearch/backends/elasticsearch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wagtail/wagtailsearch/backends/elasticsearch.py b/wagtail/wagtailsearch/backends/elasticsearch.py index 55f1971a2..45b15ffca 100644 --- a/wagtail/wagtailsearch/backends/elasticsearch.py +++ b/wagtail/wagtailsearch/backends/elasticsearch.py @@ -205,7 +205,7 @@ class ElasticSearchQuery(object): if lookup == 'in': return { 'terms': { - field_index_name: value, + field_index_name: list(value), } } From c298d5d301584f4a664776453bab688397403d4f Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Wed, 1 Oct 2014 16:33:14 +0100 Subject: [PATCH 2/2] changelog entry for #465 --- CHANGELOG.txt | 1 + docs/releases/0.7.rst | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ab57b9042..c0d90f46e 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -15,6 +15,7 @@ Changelog * 'boost' applied to the title field on searches reduced from 100 to 2 * Fix: 'wagtail start' command now works on Windows * Fix: The external image URL generator no longer stores generated images in Django's cache + * Fix: Elasticsearch backend can now search querysets that have been filtered with an 'in' clause of a non-list type (such as a ValuesListQuerySet) 0.6 (11.09.2014) ~~~~~~~~~~~~~~~~ diff --git a/docs/releases/0.7.rst b/docs/releases/0.7.rst index 061f6d45c..b07531f96 100644 --- a/docs/releases/0.7.rst +++ b/docs/releases/0.7.rst @@ -37,6 +37,7 @@ Bug fixes * The 'wagtail start' command now works on Windows and other environments where the ``django-admin.py`` executable is not readily accessible. * The external image URL generator no longer stores generated images in Django's cache; this was an unintentional side-effect of setting cache control headers. + * The Elasticsearch backend can now search querysets that have been filtered with an 'in' clause of a non-list type (such as a ``ValuesListQuerySet``). Upgrade considerations