Lowercase in facets search api I have an issue with Facets on search API (Solr Integration).


Facets items are all in lowercase, and thats not how the content type save them, and I've made a query to solr server directly and the index items there have uppercase letters


can someone help me ? 

Thx
You could use hook_facetapi_filters() to define a new filter for your facets.

/**
 * Implements hook_facetapi_filter().
 */
function MODULE_facetapi_filters() {
  return array(
    'uppercase_items' =&gt; array(
      'handler' =&gt; array(
        'label' =&gt; t('Uppercase items'), 
        'class' =&gt; 'FacetapiFilterUppercaseItems',
      ),
    ),
  );
}


and then extend the FacetapiFilter class like this:

class FacetapiFilterUppercaseItems extends FacetapiFilter {

  /**
   * Filters facet items.
   */
  public function execute(array $build) {
    // Do your magic.
    foreach ($build as $key =&gt; $value) {
      $build[$key]['#markup'] = ucfirst($value['#markup']);
    }
    return $build;
  }

  /**
   * Adds hook documentation.
   */
  function settingsForm(&amp;$form, &amp;$form_state) {
    $form['uppercase_items'] = array(
      '#title' =&gt; t('Uppercase filters'),
      '#type' =&gt; 'checkbox',
      '#default_value' =&gt; TRUE,
    );
  }     
}


I haven't actually tried this out but this is pretty much what Facet API Bonus does, which is also a great example for creating your own filters.