wiki:facets

Version 1 (modified by dwinter, 9 years ago) (diff)

--

Die Felder aus dem Index die als Facettes ausgewählt werden können. Ist in facetapi.callbacks.inc

festgelete.

 $facets['author'] = array(
    'label' => t('Author'),
    'description' => t('Filter by author.'),
    'field' => 'author_c',
    'facet mincount allowed' => TRUE,

  );


  $facets['title'] = array(
      'label' => t('Title'),
      'description' => t('Filter by title.'),
      'field' => 'title_s',
      'facet mincount allowed' => TRUE,
  );


  $facets['doc-type'] = array(
      'label' => t('Type of item'),
      'description' => t('Filter by the type of item (field: doc-type).'),
      'field' => 'doc-type',
      'facet mincount allowed' => TRUE,
      'map callback' => 'solrsearch_map_doc_type',
  );

  $facets['access-type'] = array(
      'label' => t('Access restrictions'),
      'description' => t('Filter by Access Type.'),
      'field' => 'access-type',
      'facet mincount allowed' => TRUE,
  );


  $facets['collection'] = array(
      'label' => t('Filter by collection'),
      'description' => t('Filter by Collection (field:collection).'),
      'field' => 'collection',
      'facet mincount allowed' => TRUE,
  );

 $facets['provider'] = array(
      'label' => t('Filter by provider'),
      'description' => t('Filter by Provider.'),
      'field' => 'provider',
      'facet mincount allowed' => TRUE,
  );

 $facets['data_provider'] = array(
      'label' => t('Filter by data provider'),
      'description' => t('Filter by Data provider .'),
      'field' => 'data_provider',
      'facet mincount allowed' => TRUE,
  );


 $facets['type'] = array(
      'label' => t('Filter bytype'),
      'description' => t('Filter by type .'),
      'field' => 'type',
      'facet mincount allowed' => TRUE,
  );


  $facets['year'] = array(
    'label' => t('Year'),
    'description' => t('Filter by the year.'),
    'field' => 'year',
    'query types' => array('integer'),
    'allowed operators' => array(FACETAPI_OPERATOR_AND => TRUE),
      'min callback' => 'solrsearch_get_min_integer',
      'max callback' => 'solrsearch_get_max_integer',
      'gap callback' => 'solrsearch_get_gap_integer',
      'default sorts' => array(
      array('active', SORT_DESC),
      array('indexed', SORT_ASC),
    ),
  );