Skip to content
This repository has been archived by the owner on Dec 5, 2018. It is now read-only.

Commit

Permalink
Fixed bug where dropdown menu doesn't appear when searching for files…
Browse files Browse the repository at this point in the history
… in Boardwalk (#80)
  • Loading branch information
GPelayo authored Jun 14, 2018
1 parent b78432b commit d8b444c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions responseobjects/elastic_request_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def create_autocomplete_request(
es_search = es_search.post_filter(es_filter_query)
# Apply a prefix query with the query string
es_search = es_search.query(
Q('prefix', **{'{}__raw'.format(search_field): _query}))
Q('prefix', **{'{}__keyword'.format(search_field): _query}))
return es_search

@staticmethod
Expand All @@ -232,7 +232,7 @@ def apply_paging(es_search, pagination):
# Extract the fields for readability (and slight manipulation)
_from = pagination['from'] - 1
_to = pagination['size'] + _from
_sort = '{}.keyword'.format(pagination['sort'])
_sort = pagination['sort'] if pagination['sort'] == '_score' else '{}.keyword'.format(pagination['sort'])
_order = pagination['order']
# Apply order
es_search = es_search.sort({_sort: {"order": _order}})
Expand Down

0 comments on commit d8b444c

Please sign in to comment.