Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed encoding issue for category filters

  • Loading branch information...
commit 7605352cd70a196d4dc21f7537665c31d7215462 1 parent 9f0b796
Ignacio Perez authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 api/restapi.py
View
10 api/restapi.py
@@ -1066,10 +1066,10 @@ def DELETE(self, request, version, index_name, q, start=0, function=0, category_
facet_filters = []
for k,v in category_filters.items():
if type(v) is str or type(v) is unicode:
- facet_filters.append(ttypes.CategoryFilter(k, v))
+ facet_filters.append(ttypes.CategoryFilter(_encode_utf8(k), _encode_utf8(v)))
elif type(v) is list:
for element in v:
- facet_filters.append(ttypes.CategoryFilter(k, element))
+ facet_filters.append(ttypes.CategoryFilter(_encode_utf8(k), _encode_utf8(element)))
else:
return HttpResponse('"Invalid facets filter"', status=400)
@@ -1185,13 +1185,13 @@ def GET(self, request, version, index, q, start=0, len=10, function=0, fetch='',
facet_filters = []
for k,v in category_filters.items():
if type(v) is str or type(v) is unicode:
- facet_filters.append(ttypes.CategoryFilter(k, v))
+ facet_filters.append(ttypes.CategoryFilter(_encode_utf8(k), _encode_utf8(v)))
elif type(v) is list:
for element in v:
- facet_filters.append(ttypes.CategoryFilter(k, element))
+ facet_filters.append(ttypes.CategoryFilter(_encode_utf8(k), _encode_utf8(element)))
else:
return HttpResponse('"Invalid facets filter"', status=400)
-
+
extra_parameters = {}
if snippet:
extra_parameters['snippet_fields'] = snippet
Please sign in to comment.
Something went wrong with that request. Please try again.