This project is not covered by Drupal’s security advisory policy.

Sharely.ai for Drupal replaces your site's search with one that understands meaning, and adds an Ask mode that answers questions from your own pages with citations. Every visitor sees only what Drupal lets them see.

Drupal's core search matches words. This module serves /search from a Sharely.ai workspace instead: a visitor types once and chooses whether to Search (ranked results, linking to your pages) or Ask AI (a written answer, streamed, citing the pages it came from). It stays Drupal's own search page, rendered with your theme.

Features

- One box, two things. A select before the search field chooses Search or Ask AI; only the chosen one runs, so asking never also costs you a search.
- Answers with citations. Ask streams an answer built only from this site's published pages, with [n] markers linking back to them.
- Access-aware, twice. Drupal roles are mirrored into the workspace and every page is tagged with the roles that may view it; each visitor's token carries their roles, and results are filtered against Drupal again before render. Pages visible only through per-user grants are never sent — they're counted and listed instead.
- Your theme, your markup. The search page is a Single Directory Component using your theme's own CSS custom properties. Override it in a theme with replaces: sharelyai:search-experience.
- Syncing that survives the real world. Small sites sync in the browser with a progress bar; larger sites fill a queue that cron drains. Failures retry with backoff, rate limits pause the run, and every failure is listed with its reason.
- Search activity. The status page counts what visitors searched for and, more usefully, what found nothing. Query text and result counts only — no user, no session, no IP, and nothing sent to Sharely.
- Degrades, never breaks. If the workspace is unreachable, /search falls back to Drupal core search with a notice. Disconnecting or uninstalling restores core search and leaves your workspace untouched.
- Extensible. hook_sharelyai_document_alter() and hook_sharelyai_roles_alter() let you change what is sent and who may see it.

Post-Installation

Apply the included recipe for one-step activation:

drush recipe recipes/sharelyai_search

It installs the module and core search, makes Sharely the default search page, and grants visitors permission to search. Or enable the module yourself and set the default search page in Configuration → Search and metadata → Search pages.

Then go to Configuration → Search and metadata → Sharely.ai for Drupal and click Connect to Sharely. You approve the connection in Sharely, a workspace is created for the site, and the first sync starts. Search works within minutes.

Settings cover which content types and text fields are read, whether Ask is offered, what a bare search link opens with, results per page, and how long search statistics are kept. The workspace, its API key and the Sharely URLs are not editable in the UI by design — the key comes from the connection, and the URLs belong to the deployment (see settings.example.php).

Additional Requirements

- A Sharely.ai workspace. This module is a client for the hosted Sharely.ai service; you need an account at https://sharely.ai. Without a connection, /search serves Drupal core results.
- Published content is sent to Sharely. Page text, title and URL are sent and stored there, tagged with the Drupal roles that may view them. Unpublished content and per-user-restricted pages are never sent.
- Drupal core: Node, Search, and the core Search Node page (kept installed as the fallback).
- PHP 8.2 or newer. No third-party PHP libraries.
- Cron, for sites above the in-browser sync threshold.

Recommended modules/libraries

None. The module has no third-party dependencies.

Project information

Releases