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.
Quant Search is an add-on feature with a nominal cost.
Setup
- Connect Drupal with Quant
- Enable Quant search in Dashboard
- Add the
quantcdn
project to your site, e.g.composer require drupal/quantcdn
- Enable the
quant_search
Drupal module - Go to the Drupal Quant Search admin page (
/admin/config/development/quant/search
) - You should see a
Search is enabled for *project*
message
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.
- Go to the Drupal Quant Search Pages admin page (
/admin/config/development/quant/search/pages
) - Click the
Add Quant search page
button - Fill in the page details including, at minimum,
Label
andRoute
- The page can be enabled or disabled as needed and defaults to disabled
- The options are fairly self-explanatory, but some notable options are detailed below
- 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.
- There are 3 facet styles: checkbox, select, and menu
- The
Content type
andLanguage
facets have no additional configuration - The
Taxonomy
facet requires you to select aVocabulary
- The
Facet heading
is optional, but good for UX and accessibility - For multilingual sites, the
Facet language
can be chosen - To remove any facet, click the
Remove facet
button - To add a facet, fill in the bottom facet details and click the
Add facet
button - Facets can be reordered using drag-and-drop or by changing the
Facet weight
- 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.
- Go to the Drupal Quant Search admin page for index status (
/admin/config/development/quant/search
) - Click the
Clear index
button to remove all the content from the search index - Go to the Drupal Quant Index admin page to reindex content (
/admin/config/development/quant/search/index
)
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.
- Go to the Drupal Quant
Entity configuration
admin page (/admin/config/development/quant/search/entities
) - The configuration defaults to common search requirements
- Enable or disable
node
(page) andterm
content with the checkboxes - No other configuration is currently available for taxonomy
- 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
, andContent 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
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]