When using 'Facet block' as a view display, only 10 items max are listed. It should display 14 items for the facet field I selected.

If I change the facet field, content of the block changes also but there is still only 10 items listed

Comments

msizec’s picture

Category: Support request » Bug report
ajross’s picture

If this helps at all, the limit of ten gets set at line 167 of display_facet_block.inc of the Search API Views sub-module:

$limit = empty($this->view->query->pager->options['items_per_page']) ? 10 : $this->view->query->pager->options['items_per_page'];

You can manually change this from 10 to something else (or replace $limit in the $query_options array) and it will change the max limit of facets in the block. Afraid I don't know enough about Views to know why the attempt to get the items per page setting is failing so I don't have a real solution/patch. But this is a hack if you really need it until somebody is able to come up with the permanent fix.

jtkeith’s picture

If you replace this line 167:

  $limit = empty($this->view->query->pager->options['items_per_page']) ? 10 : $this->view->query->pager->options['items_per_page'];

With this:

    // Replacement code:
    $limit = 10;
    $pager = $this->get_option('pager');
    if (isset($pager) && isset($pager['options']) && isset($pager['options']['items_per_page'])) {
      $limit = $pager['options']['items_per_page'];
    }

Then the display can find the items_per_page as set in the Views UI. Probably needs someone smarter than me to create a respectable patch.

eugene.ilyin’s picture

Status: Active » Closed (won't fix)

Looks like you're trying to report problem (actually I don't think that it's really a problem) for the search_api into the issue for module facet.