From 8903d1e74134d8c504cf0575f714bd669d9313c4 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Fri, 11 Jul 2014 16:17:03 +0100 Subject: [PATCH] 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 55f1971a2e..45b15ffca1 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), } }