Skip to content

Configuring indexing and search pages

nyeholt edited this page Jul 12, 2011 · 1 revision

Configuring indexing for types

By default, the Solr module will index any fields specified in the $searchable_fields static variable on a data type (or via an extension), and make this available for searching on too.

This behaviour can be modified by creating a Solr Type Configuration object via the "Solr" section in the CMS. Create a "Type Configuration", and select the type you want to select indexing fields for. You can then select the fields you want to index for that type, as well as any custom indexing strategies. Typically, you want to leave them as 'default', unless you specifically know you want it on a separate setting. For example, Varchar fields are typically indexed as 'text' fields, meaning they are indexed and are case-insensitive by default. If desired, you could change this to be case sensitive searching, but it is rare for this to change other than the default.

Once the indexing configuration has been changed, the system needs to be reindexed so that the field changes are taken into account - click the "Reindex content" button to do so. Ideally, install the queuedjobs module for this process to proceed as quickly as possible.

Configuring search pages

The fields configured above can then be selected as fields that are searched on in a search page. Simply select the fields to use in the search.

To boost the relevance of a particular field, select the field and a multiplier for how relevant it is to the search - those items that contain the search term in that field will be considered more relevant. This only applies when the 'sorting' is set to sort by relevance descending.