Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix pagination problems with search.
This is a cherry pick of d03353c backported to next. * Paginating wasn't working correctly for questios or forum post search results. The pages would get generated, but all results would be shown on every page. A typo was preventing the question_s and discussion_s from picking up the sliced s. * Also, this changes type_ to kind so it's less built-inny * Quoting the comment I modified and added to: If we're doing elasticsearch, then we need to update the _s variables to point to the sliced versions of S so that, when we iterate over them in the following list comp, we hang onto the version that does the query, so we can call excerpt() on it later. We only need to do this with elasticsearch. For Sphinx, search_s at this point is an ObjectResults and not an S because we've already acquired object_ids on it. Thus if we update the _s variables, we'd be pointing to the ObjectResults and not the S and then excerpting breaks. * This tests that excerpting works for elasticsearch. If it works then it means that we're excerpting with the same S that we did the query with.
- Loading branch information