I was running in to a problem where the pager wouldn't show up when I set up a view for search results I think I tracked it down to the search_api_views/includes/query.inc
It seems that the total results that come back from the query will always be the limit you set for the page or less, because the total count it's setting is from the results of the range query and not of a query that looks at all of the matches. I hope that makes sense.
On line 228
$this->query->range($this->offset, $this->limit);
On line 239:
$this->pager->total_items = $view->total_rows = $results['result count'];
The $results is the limited results so if you limit your pager to 10 results at a time then this will always return the 10 or less results this query returns.
Comments
Comment #1
andrewko commentedI guess this isn't really an issue with the views integration since the total count is coming from elsewhere (ie. where the query is running).
Comment #2
andrewko commentedMoving to Fuzzy Search. It's not an issue with Search API.
Comment #3
andrewko commentedSo it looks like Fuzzy search is setting the result count correctly at line 657 of service.inc and then resetting it to the limited query count at line 730.
Comment #7
dmegatool commentedYeah the line is even commented just above it (line 727). I commented 730 and uncommented 728 and the pager started to work again... I don't get duplicate or what so ever.
Comment #8
andrewko commentedChanging title to reflect the true issue
Comment #9
mbelos commented#7 also seems to work for me.
Comment #10
wheelercreek commentedJust chiming in here - no pagination was appearing for me at all, and the fix on #7 worked for me. Not sure why that line was commented out.
Comment #11
awolfey commentedThanks dmegatool! Committed.
Comment #13
masher commentedStill experiencing this issue on the latest D7 dev release.
Other views pagers working fine on the same installation.
Apologies if this is another issue.