diff --git a/wagtail/wagtailsearch/backends/elasticsearch.py b/wagtail/wagtailsearch/backends/elasticsearch.py index c47427d35..7b301442e 100644 --- a/wagtail/wagtailsearch/backends/elasticsearch.py +++ b/wagtail/wagtailsearch/backends/elasticsearch.py @@ -1,5 +1,8 @@ from __future__ import absolute_import +import string +import json + from django.db import models from elasticsearch import Elasticsearch, NotFoundError, RequestError @@ -8,7 +11,6 @@ from elasticsearch.helpers import bulk from wagtail.wagtailsearch.backends.base import BaseSearch from wagtail.wagtailsearch.indexed import Indexed -import string class ElasticSearchQuery(object): @@ -105,6 +107,9 @@ class ElasticSearchQuery(object): } } + def __repr__(self): + return json.dumps(self.to_es()) + class ElasticSearchResults(object): def __init__(self, backend, query, prefetch_related=[]):