Three sample setups for the Facet Mapping tab of the Opensolr Search module. Your field names will differ; the choice of Solr Type and widget is what carries over.
01 · How a mapping works
Pick the Drupal Field, keep or change the Solr Field Name, check the Solr Type, write the Display Label, then click Save configuration.
Text uses String, decimal numbers Float, whole numbers Integer, dates Date. A Drupal field that holds several values needs the multi-value type: the form refuses a single-value type for it.
The field lands in your index as its name plus the type ending, for example brand_s. Index your content again, then turn the facet on in Facet Configuration and pick its widget.
The tabs in detail: Facet Mapping and Facet Configuration.
02 · Online shop
| Drupal field | Solr Field Name | Solr Type | Widget |
|---|---|---|---|
| Brand (one value) | brand | String (single) | List |
| Color (taxonomy, several) | color | String (multi-value) | List |
| Size (list, several) | size | String (multi-value) | List |
| Rating (decimal) | rating | Float (single) | Min/Max slider |
With Drupal Commerce, Data Ingestion sends the price and currency of each product without a mapping.
03 · News site
| Drupal field | Solr Field Name | Solr Type | Widget |
|---|---|---|---|
| Section (taxonomy, one) | section | String (single) | List |
| Tags (taxonomy, several) | tags | String (multi-value) | List |
| Published date | published | Date (single) | Date range picker |
| Video length in seconds | duration | Integer (single) | Duration slider (h:mm:ss) |
04 · Course catalogue
| Drupal field | Solr Field Name | Solr Type | Widget |
|---|---|---|---|
| Department (taxonomy, one) | department | String (single) | List |
| Level (list, one) | level | String (single) | List |
| Year (whole number) | year | Integer (single) | Min/Max slider |
| Format (list, several) | format | String (multi-value) | List |
For a nested taxonomy, such as Subject and then Topic, see Hierarchical categories.