Skip to content

Commit

Permalink
ElasticSearch backend: minor PEP-8 cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
acdha committed Jan 19, 2015
1 parent ae8dae9 commit e0ce2c1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions haystack/backends/elasticsearch_backend.py
Expand Up @@ -360,7 +360,7 @@ def build_search_kwargs(self, query_string, sort_by=None, start_offset=0, end_of
interval = value.get('gap_by').lower()

# Need to detect on amount (can't be applied on months or years).
if value.get('gap_amount', 1) != 1 and not interval in ('month', 'year'):
if value.get('gap_amount', 1) != 1 and interval not in ('month', 'year'):
# Just the first character is valid for use.
interval = "%s%s" % (value['gap_amount'], interval[:1])

Expand Down Expand Up @@ -500,9 +500,10 @@ def search(self, query_string, **kwargs):
raw_results = {}

return self._process_results(raw_results,
highlight=kwargs.get('highlight'),
result_class=kwargs.get('result_class', SearchResult),
distance_point=kwargs.get('distance_point'), geo_sort=geo_sort)
highlight=kwargs.get('highlight'),
result_class=kwargs.get('result_class', SearchResult),
distance_point=kwargs.get('distance_point'),
geo_sort=geo_sort)

def more_like_this(self, model_instance, additional_query_string=None,
start_offset=0, end_offset=None, models=None,
Expand Down

0 comments on commit e0ce2c1

Please sign in to comment.