Community Documentation

Combining Fields

Last updated May 20, 2013. Created by whurleyf1 on June 7, 2012.
Edited by drunken monkey. Log in to edit this page.

Purpose

Search API has each entity field as a separate field within the index. This is good in some cases, but when you need to be able to facet on -- say -- multiple fields that map to a single taxonomy it has limits. The Search API Combined module allows multiple fields to be combined into a single field which can then imitate an existing field for the purposes of faceting.

Getting Started

First download and install the Search API Combined module. You'll then go to Configuration -> Search API and select Workflow for the appropriate index. After you've enabled the Combined fields in Data Alterations you will see an option in Callback Settings for Combined fields. Select that and click on the button "Add new field" then give it a name and select one or more fields from the list below. You can also select a field for the new field to imitate if FacetAPI is enabled. Once you've created the combined field and clicked Save configuration you'll need to go to the index's Fields and enable the new field. After you've completed this you'll need to re-index. If you want to create a facet from the new field you may need to clear the cache before going to the index's Facets and enabling it there. One thing to note, if you want to have the new field Imitate an existing field the existing field must be indexed and selected as a Facet.

Limitations

At present the module has been tested for multiple term references and not with any other field type. It is currently set to index all combined fields as lists of items so it will not work with multiple fields that have single values that expect to stay as single values -- where this is important is in sorting, for instance, since you cannot sort by multiple values with Solr.

Page status

No known problems

Log in to edit this page

About this page

Drupal version
Drupal 7.x
Audience
Programmers, Site builders
Level
Intermediate
Keywords
search, search api, tutorial
Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.
nobody click here