While Drupal Views can work with SearchStax Site Search, UI Kits provide significant advantages. When you use Drupal Views, many Site Search features (like Results Fields, Faceting, Spell Check, Sorting, Smart Answers, and Related Searches) become non-functional. That's because the Drupal View controls the search experience instead of SearchStax.
Additionally, Drupal Views are less efficient. Each additional feature requires separate modules that fire their own API requests. This can consume 4-5 search requests per user query instead of one. UI Kits interact directly with the Search API. They reduce server load and provide access to all SearchStax features through a unified management interface.
Customization with Hooks
UI Kits include hooks that let you customize searches in ways that aren't possible with Drupal Views.
beforeSearch
The beforeSearch hook lets you modify a query before it's sent. Common use cases include:
- Passing a Search Profile name
- Filtering results on a hidden field not exposed as a facet, such as a site name or language code
afterSearch
The afterSearch hook lets you adjust results after they return, before rendering. Examples include:
- Stripping out branding from titles, like removing "| CustomerName" from page titles
- Trimming long description fields to a fixed length, for example by reducing descriptions to a maximum length of 200 characters
For more information about hooks, see Using Hooks. With a UI Kit, adjustments require only a few lines of code. Achieving the same result in Drupal Views often means writing a custom PHP module.
For an in-depth look at the benefits and technical considerations of UI Kits with Drupal, see our recent blog post: Benefits of UI Kits Versus Drupal View.
What's Next
Ready to implement UI Kits? Review our UI Kits tutorials for step-by-step implementation instructions.