Skip to main 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.

note

Quant Search is an add-on feature with a nominal cost.

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
tip

For Drupal sites, the quant_search module is the preferred method for adding Quant search pages. If you add search pages within the Quant Dashboard, these will not show up in Drupal. And, any search pages created in Drupal do not show up in the Dashboard Search section. Search pages created in Drupal can be viewed with regular content in the Dashboard Content section.

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)
tip

Clearing the index means all of the search-related data is removed, but the Drupal pages will remain in Drupal and in Quant. If you have active search pages, these will show no results if the index has been cleared and not updated.

  • If you intend to remove search from your site, it is best to disable all search pages first and then clear the index
  • If you are temporarily removing search index data, make sure to reindex as soon as possible

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
tip

Excluding a content type after its content has been added to the search index, requires clearing the search index before reindexing.

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]