toastdriven/django-haystack — pull request #836 by nvllkwng (2013-07-22 21:06:26+00:00)
Title: Fix incorrect end_offset being passed into backend MLT call

Issue: The end_offset being passed to `self.backend.more_like_this` is calculated as `self.end_offset - self.start_offset`.

This causes a problem when self.start_offset is non-zero, and `self.backend.more_like_this` does `params['search_size'] = end_offset - start_offset` to calculate search_size, in many cases resulting in`params['search_size']` being negative.

Passing `self.end_offset` as `search_kwargs['end_offset']` fixes the problem.

Related: http://stackoverflow.com/questions/14128593/elasticsearch-exception-with-more-like-this-in-django-haystack