Skip to content

Using the Drupal Quant Search module

The optional Drupal Quant Search (quant_search) submodule allows for creating Quant Search Pages within Drupal. Quant Search leverages the powerful Algolia search platform.

Setup

  1. Connect Drupal with Quant
  2. Enable Quant search in Dashboard
  3. Add the quantcdn project to your site, e.g. composer require drupal/quantcdn
  4. Enable the quant_search Drupal module
  5. Go to the Drupal Quant Search admin page (/admin/config/development/quant/search)
  6. You should see a Search is enabled for *project* message

Search Pages

Unlimited Quant search pages can be added in Drupal. They are pushed to Quant automatically when creating or updating search pages.

  1. Go to the Drupal Quant Search Pages admin page (/admin/config/development/quant/search/pages)
  2. Click the Add Quant search page button
  3. Fill in the page details including, at minimum, Label and Route
  4. The page can be enabled or disabled as needed and defaults to disabled
  5. The options are fairly self-explanatory, but some notable options are detailed below
  6. Click the Save button to save the search page and send the page to Quant

Manual filters

See the Algolia Filter documentation for details on the types of filters that can be added.

Facets

Search facets can be added and will allow the user to filter the content.

  1. There are 3 facet styles: checkbox, select, and menu
  2. The Content type and Language facets have no additional configuration
  3. The Taxonomy facet requires you to select a Vocabulary
  4. The Facet heading is optional, but good for UX and accessibility
  5. For multilingual sites, the Facet language can be chosen
  6. To remove any facet, click the Remove facet button
  7. To add a facet, fill in the bottom facet details and click the Add facet button
  8. Facets can be reordered using drag-and-drop or by changing the Facet weight
  9. After changing any facet information, click the Save button

Search Index

The Quant Search index contains all the information sent to Quant based on the entity configuration and search pages.

  1. Go to the Drupal Quant Search admin page for index status (/admin/config/development/quant/search)
  2. Click the Clear index button to remove all the content from the search index
  3. Go to the Drupal Quant Index admin page to reindex content (/admin/config/development/quant/search/index)

Entity Configuration

Some of the search results details are configurable such as the result title, summary, image, and view mode.

  1. Go to the Drupal Quant Entity configuration admin page (/admin/config/development/quant/search/entities)
  2. The configuration defaults to common search requirements
  3. Enable or disable node (page) and term content with the checkboxes
  4. No other configuration is currently available for taxonomy
  5. Click the Save configuration button to save changes

Node Configuration

Search content for nodes (pages) can be configured per content type.

  • There are default options for Title, Summary, Image, and Content view mode
  • For each content type, there are overrides available for these options
  • Content types can also be excluded from the search index entirely
  • Reindex content if the configuration has changed

Images

To show images in the search results, update the image token to the correct image style for your content type. Example:

[node:field_image:medium:url]