in apachesolr_search.module, the $params['rows'] value is set before any changes set by hook_apachesolr_modify_query_alter().

You can see this bug by setting the default setting to '10' on the apache solr settings page. Then implement hook_apachesolr_modify_query_alter() and set $params['rows'] to your value, say '5'.

For example, If your search returns 15 items,
Page 1 will have 5 results (0-4),
Page 2 will have 5 results (10-14), starts at 10
Page 3 will show nothing, starts at 20

CommentFileSizeAuthor
#1 apachesolr-554136.patch1.05 KBemackn

Comments

emackn’s picture

StatusFileSize
new1.05 KB

This patch just moves the params['start'] paging setting down below the hook call.

Jaza’s picture

Status: Active » Reviewed & tested by the community

I needed to expose $params['rows'], to allow users to change the no. of results per page through a custom search form.

Applying this patch allowed me to do this. Patch works and is needed.

robertdouglass’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed to both branches.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.