Facet Mapping: Drupal Fields to Index Fields

Send your own Drupal fields to the index

Facet Mapping

Map a Drupal field, such as a brand, a color or a taxonomy, to a field of your Opensolr Index. Once your content is indexed again, it can be a facet, a sort, or the image of your results.

Where: Opensolr Search › Facet Mapping tab › Facet Mapping section

Add a mapping

  1. Drupal Field: pick the field. Each option tells you whether the field holds one value or many, and of what kind.
  2. Solr Field Name: the name in your index, filled in from the Drupal field. Change it if you like, for example brand.
  3. Solr Type: suggested for you from the Drupal field; check it against the table below.
  4. Display Label: the name visitors see, for example Brand.
  5. Add another mapping for the next field, Remove to drop one, then Save configuration.

Solr Type

Kind of valueOne valueMany values
Text (a brand, a tag)String (single), _s, the defaultString (multi-value), _sm
Decimal number (a price, a weight)Float (single), _fFloat (multi-value), _fm
Whole number (a year, seconds)Integer (single), _iInteger (multi-value), _im
DateDate (single), _dtDate (multi-value), _dtm

The field lands in your index as its name plus that ending, for example brand_s. A Drupal field that allows several values must use a multi-value type; the form refuses a single-value type for it. String (single, legacy), _ss, is kept for older setups.

Index again before you look for the facet

A new mapping only reaches documents indexed after it. Run Ingest All Now, or Reindex Everything if you crawl. Then the field appears in Facet Configuration.

Both ways in carry your mappings: Data Ingestion writes them into each document, and the Data Crawler reads them from meta tags the module adds to your pages. More on custom fields: Dynamic fields.

Facets