On a search view I have two facet blocks, and both only display 1 item to filter the list. Changing settings on the facet does not make any difference.

If I look at the database table (search_api_db_kaufindex) there are 18 elements with the taxonomy term "71", 3 with the term "72" and 3 with the term "73". But the facet block only lists the term with id "71" as possible link to filter the view. The view, when not filtered, displays all 24 nodes.

This happens whether I use the stable 7.x-1.11 or the latest dev (2014-May-15).

This is the facet configuration:

$facet = new stdClass();
$facet->disabled = FALSE; /* Edit this to true to make a default facet disabled initially */
$facet->api_version = 1;
$facet->name = 'search_api@kaufindex:block:field_category';
$facet->searcher = 'search_api@kaufindex';
$facet->realm = 'block';
$facet->facet = 'field_category';
$facet->enabled = TRUE;
$facet->settings = array(
  'weight' => 0,
  'widget' => 'facetapi_links',
  'filters' => array(
    'active_items' => array(
      'status' => 0,
      'weight' => '-50',
    ),
    'current_depth' => array(
      'status' => 0,
      'weight' => '-49',
    ),
  ),
  'active_sorts' => array(
    'active' => 'active',
    'count' => 'count',
    'display' => 'display',
    'indexed' => 0,
  ),
  'sort_weight' => array(
    'active' => '-50',
    'count' => '-49',
    'display' => '-48',
    'indexed' => '0',
  ),
  'sort_order' => array(
    'active' => '3',
    'count' => '3',
    'display' => '4',
    'indexed' => '4',
  ),
  'empty_behavior' => 'none',
  'soft_limit' => '50',
  'nofollow' => 1,
  'show_expanded' => 1,
  'ranges' => '',
  'default_option_label' => '',
  'submit_page' => '',
  'keep_open' => 0,
  'expand' => 1,
  'collapsible_children' => 0,
  'empty_text' => array(
    'value' => '',
    'format' => 'filtered_html',
  ),
  'submit_realm' => 'Save and go back to realm settings',
);

Comments

Anonymous’s picture

Title: Facet Block only displays 1 item » Facet block only displays 1 item
Anonymous’s picture

Issue summary: View changes
Anonymous’s picture

Issue summary: View changes
drunken monkey’s picture

Try to enable the "Flatten hierarchy" option for the facet.

St_B’s picture

@drunken monkey what is the flatten hierarchy ? (sorry my english is not good...)

I have the same problem, and noticed it happens when
1. I put 2 or more terms in the search box
2. in the research view, the index is set on "search all these terms".

When I change this option to "one of these terms" the facets are correct. But of course the search results are not satisfactory...

[edit : @drunken-monkey I understood the flatten hierarchy was for taxonomy terms ; in my case, there isn't any taxonomy terms with hierarchy in fields indexed and the problem is there.]

St_B’s picture

ok it seems to be this problem ! https://www.drupal.org/node/1403916

drunken monkey’s picture